How do you check if a user is logged in with React?
Check if a user has previously logged in getItem(“user”); if (loggedInUser) { const foundUser = JSON. parse(loggedInUser); setUser(foundUser); } }, []); Remember to use an empty dependency array in your useEffect hook so that it checks if there’s a logged in user the first time the app loads.
Read moreHow do you check if user is signed in Firebase in React?
“firebase auth check if user is logged in” Code Answer
Read more