Can’t implement a server-side header in Nested Layouts (no flicker, auth + country detection) #82789
Unanswered
GlebKodrik
asked this question in
Help
Replies: 4 comments 1 reply
-
server actions don't work either. The whole tree becomes server |
Beta Was this translation helpful? Give feedback.
0 replies
-
API Route works, but the cookie is not read and does not work properly (but this is the only option that I see, I will study it) |
Beta Was this translation helpful? Give feedback.
0 replies
-
could you sketch a React tree of how things should look like at the end? |
Beta Was this translation helpful? Give feedback.
1 reply
-
@icyJoseph |
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.
-
Hello, I’m struggling a lot with implementing a server-side header in the App Router.
What I need:
What I tried:
The main problem:
I need the header to always be server-rendered, even on error pages, so it has the correct country + auth state right away, with no client-side re-fetch and no flickering.
Is there a recommended way to achieve this in App Router?
Or maybe an example of how to structure layouts/templates so that a server component header works consistently across normal pages and error pages?
I’ve tried everything but I feel stuck. Any advice or best practices would be greatly appreciated 🙏
Beta Was this translation helpful? Give feedback.
All reactions