title: React.Js Passing props from component to NavBar component?
body: <p>So I have React.JS page and this page is made out of two parts.
  The NavBar and the page content.</p>
  <p>In the App.js I am passing props to the page and I want to display this props in the NavBar as Page title. How can I do this ?, basicaly every link has it own props, which is the name of the page and I wouls like to display this props in the PageHeader component.</p>
  <pre><code>import {BrowserRouter as Router, Route, Switch } from &quot;react-router-dom&quot;;
  import Banany from &quot;./Banany&quot;;
  import Broskve from &quot;./Broskve&quot;;
  import PageHeader from &quot;./Components/PageHeader&quot;;
  import Home from &quot;./Home&quot;;
  import Hrusky from &quot;./Hrusky&quot;;
  
  
  function App() {
    return (
      &lt;Router&gt;
        &lt;PageHeader/&gt;
  
        &lt;Switch&gt;
          &lt;Route exact path=&quot;/&quot;&gt;
            &lt;Home pageTitle=&quot;Home&quot;/&gt;
          &lt;/Route&gt;
          &lt;Route path=&quot;/banany&quot;&gt;
            &lt;Banany pageTitle=&quot;Bananas&quot;/&gt; &lt;--- I want to display Bananas in PageHeader component
          &lt;/Route&gt;
          &lt;Route path=&quot;/broskve&quot;&gt;
            &lt;Broskve pageTitle=&quot;Broskve&quot;/&gt;
          &lt;/Route&gt;
          &lt;Route path=&quot;/hrusky&quot;&gt;
            &lt;Hrusky pageTitle=&quot;Pears&quot;/&gt;
          &lt;/Route&gt;
        &lt;/Switch&gt;
  
      &lt;/Router&gt;
    );
  }
  
  export default App;
  </code></pre>