title: Pass dynamic url to React Router
body: <p>I use react-router-dom version ^5.1.2 and try to pass dynamic property. My root component looks like this:</p>
  <pre><code>export const RegisterRoutes: React.FunctionComponent&lt;RouteComponentProps&gt; = ({
    match,
  }: RouteComponentProps) =&gt; {
    const root = match.url;
  
    return (
      &lt;Switch&gt;
        &lt;Route exact path={`${root}/success`} component={RegisterSuccess} /&gt;
        &lt;Route exact path={`${root}/success/email`} component={RegisterEmail} /&gt;
        &lt;Route exact path={`${root}/confirmation/email/:code`} component={RegisterEmailConfirmation} /&gt;
        &lt;Redirect to={root} /&gt;
      &lt;/Switch&gt;
    );
  };
  
  </code></pre>
  <p>Here is a child RegisterEmailConfirmation component:</p>
  <pre><code>export const RegisterEmailConfirmation: React.FunctionComponent&lt;RouteComponentProps&gt; = ({ match }) =&gt; {
  
    console.log(match.params.code) // expected 'code' property from the url 
  
    return (
       &lt;SomeContent /&gt;
      /&gt;
    );
  
  </code></pre>
  <p>I have an url from the BE with dynamic 'code' parameter, it looks like this: register/confirmation/email?code=fjds@dfF. How can I render RegisterEmailConfirmation component and read 'code' property inside? What's wrong with my code?</p>