title: Getting location prop in the component where BrowserRouter is initialized
body: <p>I am trying to make <code>react-router</code> work with <code>transition-group</code> but stumbled on the problem, that I can not access <code>location</code> prop directly in this component. Is there a solution that does not require creation of another child component that I would wrap into <code>withRouter</code> to access the <code>location</code>?</p>
  
  <pre><code>class App extends React.Component {
    public render() {
      return (
        &lt;BrowserRouter basename={process.env.PUBLIC_URL}&gt;
          &lt;React.Fragment&gt;
            &lt;Navigation language={"en"} /&gt;
            &lt;Switch&gt;
              &lt;TransitionGroup&gt;
               &lt;CSSTransition location={this.props.location} timeout={300} classNames="fade"&gt; 
                &lt;Route
                  path="/p"
                  render={() =&gt; {
                    return (
                      &lt;Layout&gt;
                        &lt;P/&gt;
                      &lt;/Layout&gt;
                    );
                  }}
                /&gt;
                &lt;Route
                  path="/v"
                  render={() =&gt; {
                    return (
                      &lt;Layout&gt;
                        &lt;V/&gt;
                      &lt;/Layout&gt;
                    );
                  }}
                /&gt;
               &lt;/CSSTransition&gt; 
              &lt;/TransitionGroup&gt;
            &lt;/Switch&gt;
          &lt;/React.Fragment&gt;
        &lt;/BrowserRouter&gt;
      );
    }
  }
  </code></pre>