title: Displaying new link after login [REACT]
body: <p>I am creating login form in REACT. The email/password are checked versus database record and if login successful I want to store session and display link to extra component in the header. I got this to work however after every login/logout I need to refresh the browser manually to display the extra link. Can anyone point me to what I am doing wrong ? </p>
  
  <p>Login.js</p>
  
  <pre><code> fetch('http://localhost:5000/getUsers')
              .then((data) =&gt; data.json())
              .then((data) =&gt; {
                  // console.log(data);
                  return data.filter(user =&gt; (user.EMAIL === email &amp;&amp; user.PASSWORD === password));
              })
              .then((data) =&gt; {
                  if (data.length === 1) {
                      localStorage.setItem('user', data[0].EMAIL);
                      localStorage.setItem('isLoggedIn',true);
                      this.setState({email:data[0].EMAIL, password: data[0].PASSWORD, isLoggedIn: true })
  </code></pre>
  
  <p>In my routing</p>
  
  <pre><code>const routing = (
    &lt;Router&gt;
      &lt;div&gt;
          &lt;Header name={localStorage.getItem("user")}  /&gt;
  </code></pre>
  
  <p>In the Header component</p>
  
  <pre><code>this.state = {
              name : this.props.name
          }
  
  {(this.state.name !== "") ?
                      &lt;li&gt; &lt;a href="/updateLiveGames"&gt;Update Live Games&lt;/a&gt;&lt;/li&gt;
                      :
                      ""
                  }
  </code></pre>
  
  <p>This works but I need to refresh browser (F5). </p>
  
  <p>Thanks for any help. </p>
  
  <p>I expect to login user and display extra link in my header only when user logged in.</p>