title: How to stop firebase re-auth() on every page reload in a react app?
body: <p>So i have this great react app using firebase auth and firestore.
  Everything working fine except</p>
  <p>Whenever i reload the page while a user is already logged in... navbar links change for a second.
  Looks like app automatically re-login(re-auth) the user on every page reload. Why so? How to get rid of it? Some look-alike code sample</p>
  <pre><code>import React, {useState, useEffect} from 'react';
  import {Switch, Route} from 'react-router-dom'
  import firebase from 'firebase/App'
  
  export const App = () =&gt; {
      const [isAuth, setIsAuth] = useState()
      const auth = firebase.auth()
  
      useEffect(() =&gt; {
          auth.onAuthStateChanged(user =&gt; {
              if(user) {
                  setIsAuth(true)
              } else {
                  setIsAuth(false)
              }
          })
      }, [isAuth])
  
      return(
          &lt;div className=&quot;App&quot;&gt;
              &lt;Navbar /&gt;
              &lt;Switch&gt;
                  &lt;Route to=&quot;/signIn&quot; component={Login} /&gt;
                  &lt;Route to=&quot;/signUp&quot; component={SignUp} /&gt;
                  &lt;Route to=&quot;/signOut&quot; component={SignOut} /&gt;
              &lt;/Switch&gt;
          &lt;/div&gt;
      )
  };
  </code></pre>