title: Dynamic page title with ReactJS
body: <p>I want to make a Dynamic page title on ReactJS. I try a lot of things , but didn't succeed. I make an array with data:</p>
  
  <pre><code>let pageTitles = [
      {key:"/Home", title:"Welcome Home"},
      {key:"/SecondPage", title:"Shop"},
      {key:"/ThirdPage", title:"ContactUs"},
  ];
  </code></pre>
  
  <p>In html is only <code>&lt;title&gt;&lt;/title&gt;</code> , I use <code>let pathname = window.location.pathname;</code> If it return "/Home" or "/ThirdPage" to set a new title dynamically. 
  I've tried something like that:</p>
  
  <pre><code>for (var i = 0, len = pageTitles.length; i &lt; len; i++) {
          if (pageTitles[i].key === pathname) {
              var hhh = pageTitles[i].text;
          }
      }
  document.title = hhh
  </code></pre>
  
  <p>But obviously didn't work. I'm sorry if there is a topic like that, but I didn't found it.I have a restriction to install modules.</p>