title: react router get props in parent
body: <p>Let's take this basic template </p>
  
  <pre class="lang-js prettyprint-override"><code>export default function App() {
    return (
      &lt;Router&gt;
         &lt;Header /&gt;
          &lt;Switch&gt;
            &lt;Route path="/about"&gt;
              &lt;About /&gt;
            &lt;/Route&gt;
            &lt;Route path="/users"&gt;
              &lt;Users /&gt;
            &lt;/Route&gt;
            &lt;Route path="/"&gt;
              &lt;Home /&gt;
            &lt;/Route&gt;
          &lt;/Switch&gt;
      &lt;/Router&gt;
    );
  }
  </code></pre>
  
  <p>There is no problem to access <code>props.match</code> from <code>About</code> or <code>Users</code>.</p>
  
  <p>I would like to access with <code>Header</code>, using <code>withRouter</code> I have <code>props.match.path</code> always equal to <code>/</code>, I would like the path to be <code>/user</code> when I am in the <code>Users</code> component for example.</p>
  
  <p>I would change my header render in function of <code>props.match.params</code> elements</p>