Pattern for Sharing Session with Client Components in Next.js 13 App Directory #7849
bestickley
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
I get console errors when I try to do // https://github.com/nextauthjs/next-auth/discussions/7849#discussion-5322909
'use client'
export { SessionProvider } from 'next-auth/react' in a
I'm using |
Beta Was this translation helpful? Give feedback.
4 replies
-
Love this! I using a longer way to achieve the same effect. Thank you! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I've come across a pattern for sharing
session
across client components in Next.js 13 app directory with route groups that I wanted to share and get feedback on. The key is to notice the server component providing the session withSessionProvider
in app/(private)/layout.tsx and the client component consuming the session in app/(private)/dashboard/Dashboard.tsx.Beta Was this translation helpful? Give feedback.
All reactions