We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, maybe I am missing something but shouldn't a (context) provider be at least one layer/level above the consumer?
Looking at migrating-to-v5 the section (Step 4 Details -> Client component (App)) does not look right.
'use client'; import { useSession, SessionProvider } from 'next-auth/react'; const ClientComponent = () => { const session = useSession(); return ( <SessionProvider> <p>Welcome {session?.user?.name}</p> </SessionProvider> ) }
I think it should be something like the following instead.
import { SessionProvider } from 'next-auth/react'; import { ClientComponent } from '@/components'; const ParentComponent = () => { return ( <SessionProvider> <ClientComponent /> </SessionProvider> ) }
'use client'; import { useSession } from 'next-auth/react'; const ClientComponent = () => { const session = useSession(); return ( <p>Welcome {session?.user?.name}</p> ) }``` ### Does the docs page already exist? Please link to it. https://authjs.dev/getting-started/migrating-to-v5
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What is the improvement or update you wish to see?
Hello, maybe I am missing something but shouldn't a (context) provider be at least one layer/level above the consumer?
Looking at migrating-to-v5 the section (Step 4 Details -> Client component (App)) does not look right.
Is there any context that might help us understand?
I think it should be something like the following instead.
The text was updated successfully, but these errors were encountered: