title: React-router: never unmount a component on a route once mounted, even if route change
body: <p>I have a React application that declares some routes :</p>
  <pre><code>&lt;Switch&gt;
        &lt;Route exact path={'/'} render={this.renderRootRoute} /&gt;
        &lt;Route exact path={'/lostpassword'} component={LostPassword} /&gt;
        &lt;AuthenticatedRoute exact path={'/profile'} component={Profile} session={session} redirect={'/'} /&gt;
        &lt;AuthenticatedRoute path={'/dashboard'} component={Dashboard} session={session} redirect={'/'} /&gt;
        &lt;AuthenticatedRoute path={'/meeting/:meetingId'} component={MeetingContainer} session={session} redirect={'/'} /&gt;
        &lt;Route component={NotFound} /&gt;
  &lt;/Switch&gt;
  </code></pre>
  <p>(<code>AuthenticatedRoute</code> is a dumb component that checks the session, and either call <code>&lt;Route component={component} /&gt;</code> or <code>&lt;Redirect to={to} /&gt;</code>, but at last, <code>component</code> method is invoked)</p>
  <p>Where basically each component is mounted/unmounted on route change. I'd like to keep that aspect <strong>except</strong> for the <code>Dashboard</code> route which does a lot of things, and that I would like to be unmounted once not on dashboard (let's say you arrive on a meeting page, you do not need to mount your dashboard yet) but once you loaded once your Dashboard, when you go on your profile page, a meeting or whatever, when you go back on your Dashboard the component does not have to mount again.</p>
  <p>I read on React-router doc that <a href="https://reacttraining.com/react-router/web/api/Route/render-func" rel="nofollow noreferrer">render</a> or children might be the solution, instead of component, but could we mix routes with children and other with component? I tried many things and never achieved what I wanted, even with <code>render</code> or <code>children</code>, my Dashboard component is still mounting/unmounting.</p>
  <p>Thanks for your help</p>