title: Passing parameters to dynamically generated react routes
body: <p>I'm using <code>react-router-dom</code> and generate my routes dynamically from an array like so</p>
  
  <p><strong>Routes Data</strong></p>
  
  <pre><code>const routes = [
    {
      path: '/',
      exact: true,
      component: () =&gt; &lt;MyComponent /&gt;
    }
  }
  </code></pre>
  
  <p><strong>Route Generation</strong></p>
  
  <pre><code>{routes.map((route, index) =&gt; {
    return &lt;Route
      key={index}
      path={route.path}
      exact={route.exact}
      component={route.component}
    /&gt;
  })}
  </code></pre>
  
  <p>Render Prop
  I found out about the render() prop I could define but even so how do I do this since the component is inside a variable</p>
  
  <pre><code>const props = this.props;
  {routes.map((route, index) =&gt; {
    return &lt;Route
      key={index}
      path={route.path}
      exact={route.exact}
      render={(props) =&gt; &lt;??? {...props} /&gt;
    /&gt;
  })}
  </code></pre>
  
  <p>How can I pass this.props during the route generation?</p>