title: Firebase authentication delay React JS Functional Components
body: <p>I'm aware this question has been asked before, but most talk about React class based components. I'm after an updated solution using React functional components.</p>
  <p>I have a web app that only displays a signout button if the user is already signed in. However, when the page loads, if a user was signed in it takes about a second to display the signout button. In the meantime, it is displaying the signin button (even though the user is already signed in). This looks unprofessional. I'm using onAuthStateChanged.</p>
  <p>After reading around, I'm aware that this is to do with the app fetching the sign-in status from Firebase's servers. I'm also aware that when you log in, firebase automatically stores the loggedin user to the local storage.</p>
  <p>The solution, I understand, is to just check whether the local storage contains the user data and if it does, then execute code.</p>
  <p>How do I go about implementing this?</p>