-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
questionAsk how to do something or how something worksAsk how to do something or how something works
Description
Your question
I'm using the id from useSession like the following:
import { useSession } from 'next-auth/client'
Then, I'm importing the session value like the following:
const [ session, loading ] = useSession()
I'm using the value of the id from session. However, since a call to /api/auth/session is made whenever the browser is in focus, the state of my application reloads and it fetches data again as the parent component is re-rendered. See the screenshot below:
What are you trying to do
The whole application shouldn't be re-rendered. One possible solution could be that we can store the id from the session object in a cookie or localStorage and use it on every API call. However, I'd like to know if there is a better solution than this.
- Found the documentation helpful
- Found documentation but was incomplete
- Could not find relevant documentation
- Found the example project helpful
- Did not find the example project helpful
Metadata
Metadata
Assignees
Labels
questionAsk how to do something or how something worksAsk how to do something or how something works
