title: React passing props down through switch element
body: <p>I'm having an issue passing props through React elements (like Switch and Route). In the example below, I would like to pass all props of Dashboard component down to the Account component. Is there a way to achieve this?</p>
  
  <p><strong>App.js</strong></p>
  
  <pre><code>  &lt;Dashboard&gt;
      &lt;Switch&gt;
        // Dashboard props to Account component
        &lt;Route path="/account" render={props =&gt; &lt;Account {...props} /&gt; } exact /&gt;
        &lt;Route path="/someothercomponent" component={Someothercomponent} /&gt;
      &lt;/Switch&gt;
    &lt;/Dashboard&gt;
  </code></pre>
  
  <p><strong>Dashboard.js</strong></p>
  
  <pre><code>  render() {
        const children = React.Children.map(this.props.children, child =&gt; {
            var router = React.cloneElement(child, { image: this.state.image });
            return router;
            // Like this the router Element does receive the image prop from
            // the Dashboard component. Now this image prop needs to be
            // passed on to the Account component.
  
        }
  </code></pre>