title: How to let React Router render only when navigated to
body: <p>I have the follow routes in my landing page. </p>
  
  <pre><code>            ...
  
              &lt;Route exact path='/MainPage' render={(match, history) =&gt; {
                  return &lt;MainPage&gt;&lt;/MainPage&gt;
              }}/&gt;
  
              &lt;Route exact path='/Search' render={(match, history) =&gt; {
                  return  &lt;SearchPage&gt;&lt;/SearchPage&gt;
              }}/&gt;
  
              &lt;Route exact path='/Register' render={(match, history) =&gt; {
                  return &lt;RegisterPage&gt;&lt;/RegisterPage&gt;
              }}&gt;&lt;/Route&gt;
  
              &lt;Route exact path='/HTTP' render={(match, history) =&gt; {
                  return &lt;HTTPPage&gt;&lt;/HTTPPage&gt;
              }}&gt;&lt;/Route&gt;
  
              ...
  </code></pre>
  
  <p>The problem I'm having is that these pages are rendered immediately when the landing page is opened, which means all the css files in these routes are rendered too. For example, in the SearchPage/index.js I have:</p>
  
  <pre><code>import '../style_sheets/mainComponents.css'
  </code></pre>
  
  <p>When I open the browser inspector on the landing page I see all of these css files are rendered as style tags in the . A lot of these css files have class selectors which adversely modify how things look on the landing page. Is there a way to suppress the rendering of these routes or simply somehow separate the imported css in the children elements from their parent page?</p>