title: Accessing this.props.location.pathname within the Route component
body: <p>On my SideMenuNavigation component where I have the <code>&lt;Route&gt;</code> codes, I need to access the value of <code>this.props.location.pathname</code>. Unfortunately, I'm getting <code>undefined</code>.</p>
  
  <pre><code>class SideNavigation extends React.Component {
  
    componentDidMount() {
      console.log(this.props.location.pathname); // undefined
    }
  
    render() {
      return(
       &lt;Router&gt;
         &lt;Route exact path="/" component={Dashboard}/&gt;
       &lt;/Router&gt;
      )
    }
  }
  
  
  /*   */
  </code></pre>
  
  <p>In my Dashboard component, I can acess <code>this.props.location.pathname</code> successfully. Unforunately, I don't need it from this component. I need the value in the <code>SideMenuNavigation</code> component.</p>