title: Switch statement depends on React-Router Route
body: <p>i'm trying to change text in p depends on which Route is enabled. I was trying to make this with switch statement, but honestly don't know how, any ideas?</p>
  
  <pre><code>import React from 'react';
  import '../styles/Main.css'
  import { Switch, Route } from 'react-router-dom';
  import DaysWeather from '../pages/DaysWeather';
  import WorldWeather from '../pages/WorldWeather'
  import CurrentWeather from '../pages/CurrentWeather';
  
  const Main = () =&gt; {
  
  return (&lt;&gt;
      &lt;main&gt;
          &lt;p&gt;Sprawdź pogodę w swoim mieście&lt;/p&gt;
          &lt;Switch&gt;
              &lt;Route path="/" exact component={CurrentWeather} /&gt;
              &lt;Route path="/daysweather" exact component={DaysWeather} /&gt;
              &lt;Route path="/worldweather" exact component={WorldWeather} /&gt;
          &lt;/Switch&gt;
     &lt;/main&gt;
  
  
  &lt;/&gt;);
  }
  
  
  export default Main;
  </code></pre>