-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
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
RootLayout - how to provide currentUser to entire app while maintaining RootLayout as a server component #305
Comments
@jamezening can you try something like this:
|
@jamezening There is a |
@pashpashpash thank you for the suggestion. Either GH Co-Pilot or Cursor AI suggested this method for me but I couldn't get it to work. Did this method end up working for you? |
@adrolc I ended up going this way, while moving the |
Currently in the RootLayout, the
currentUser
is only provided to the<Header>
component.Is there a way to "provide" the
currentUser
to the entire app (including<main>
and its children), without making the RootLayout into a client component so that user related state is available not just inHeader
?There are other Firebase + NextJS examples out there that wrap the entire
<main>
tag in a React Context Provider - still figuring out if it is performant to make the RootLayout into a client component.Thank you for any insights on this matter.
The text was updated successfully, but these errors were encountered: