FeatureFuel
2

Expand useUser to have isLoading state like useSessionContext

Source: supabase/supabase#13221 · opened by @gurkang
For checking if a user is logged in and if I can/should be fetching data I initially check in a useEffect like this:



But the only reason I have to use useSessionContext here is because useUser can return null while it's loading the session/user.
If useUser exposed a loading state it could be simplified down to:




I think it's more convenient to do it this way and only having to use useUser hook to check on clientSide if the user is logged in and has an active session.

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests