Skip to content

useEffect fires even when the session is undefined #2258

Answered by balazsorban44
jackmerrill asked this question in Help
Discussion options

You must be logged in to vote

It's a React hook issue. Have a read on https://reactjs.org/docs/hooks-rules.html#only-call-hooks-at-the-top-level 😊

Update: Maybe I misunderstood, but be careful with the naming of your functions. use is usually reserved for React hooks. The problem is still not next-auth specific though. you will need an early return when session is undefined

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jackmerrill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants