title: React Router 4 - accessing child params
body: <p>I need to get access to the params (e.g. match.params) for a child component.  For example:</p>
  
  <pre><code>const Vets = ({ match }) =&gt; (
    &lt;div&gt;
      &lt;LeftMenu vetId={match.params.vetId} catId=??? /&gt;
      &lt;div&gt;
        &lt;Switch&gt;
          &lt;Route path={`${match.path}/cats/:catId`} component={Cat} /&gt;
          &lt;Route path={`${match.path}/dogs/:dogId`} component={Dog} /&gt;
        &lt;/Switch&gt; 
      &lt;/div&gt;
      &lt;RightActionBar /&gt; (&lt;- uses withRouter to get vetId.  Would like to get catId)
    &lt;/div&gt;
  )
  </code></pre>
  
  <p>URL: myapp.com/vets/12/cats/194</p>
  
  <p>In the Vet component I can access match.params and get any params that were in the section of the URL that matched in the parent to present this component (such as vetId, but not catId).  Also, if I use withRouter in the RightActionBar component, I can get the same match.params, BUT NOT THE CAT OR DOG ID.</p>
  
  <p>In the Cat and Dog components, I can access props.match.params and get the params available above AND THE CAT OR DOG ID. </p>
  
  <p>Lets say I want to know the cat or dog id in the LeftMenu or RightActionBar component.  How would I access it?</p>
  
  <p>As far as I can tell, this was doable in earlier versions through props.params, but not any more.  I know I could use the location prop and write my own function to work it out, but my app is a little more complex than the example and I'm hoping theres a more elegant solution out of the box that I've missed.</p>