Ifycode-extension / buuks-react-client

Client for @Ifycode's buuks API (react, typescript, tailwind css)
https://buuks.netlify.app
3 stars 0 forks source link

UseEffect in useAuth hook/provider #7

Open Ifycode opened 2 years ago

Ifycode commented 2 years ago
useEffect(() => { 
    // Set isloading to true

    // read token from local storage
    // if token exists, 
        // read user data from local storage
        // set the user variable
        // set isAuthenticated to true

    // if token doesn't exist, 
        // set isAuthenticated to false

    // set isLoading to false
  }, []);

One of the suggestions from @faarda