Skip to content

Do Server Components re-render when Client Components re-render? #70054

Answered by magnusriga
magnusriga asked this question in Help
Discussion options

You must be logged in to vote

I think I found the answer.

In the Docs section on invalidating the Router Cache, it is stated that the Router Cache is invalidated when cookies are set/deleted in a SA. Meaning, next time any (soft) navigation is done within the app, a new request is sent to the server to get the new RSC payload.

So, even though setting cookies invalidates the cache, it does not immediately send a new request to the server.

router.refresh(), on the other hand, both invalidates the Router Cache and immediately sends a new request to the server so dynamic server components re-render.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by magnusriga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants