title: Dynamic Header in a SPA using react
body: <p>I'm fairly new to react and am building my own SPA right now.</p>
  <p>The current layout of my App.js file is close to this:</p>
  <pre><code>&lt;div className=&quot;h-100&quot;&gt;
    &lt;Header&gt;&lt;/Header&gt;
    &lt;div className=&quot;&quot;&gt;
      &lt;Route exact path='/' component={Construction}&gt;&lt;/Route&gt;
      &lt;Route path='/impressum' component={Impressum}&gt;&lt;/Route&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I want to change the layout of the Header component depending on which Route is currently selected.
  What is the best way to determine that? My go to solution would be by current URL but I don't know whether there is a better way.</p>