PPR for rerendered dynamic components within non-rerendered layouts #63827
eric-burel
started this conversation in
Ideas
Replies: 0 comments
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.
-
Goals
Background
The blocker for accessing URL in RSCs is that RSC layouts are not rerendered during client-side navigation.
This designs however "leaks" in components, because this also means that no RSC can ever access the URL directly, because they could potentially be within a layout.
This affects RSCs that are never actually rendered in a layout.
The current palliative is using a client-side component and the
useSearchParams()
hook. Or page-levelsearchParams
props drilling or setting a server-context to pass the value down. There is no component-level pattern that allows accessing searchParams directly in a RSC.Parallel routes are sometimes mentioned as a palliative but I fail to wrap my head around them for this particular use case.
Slightly related to extending PPR to the layout/page relationship so the layout can define static requirements but pages can be either dynamic or static (currently a static layout won't work with dynamic pages): #44712
Related to this hot issue: #43704
Proposal
All in the title. We could have a mechanism similar to what PPR does for dynamic components within static pages, but for layouts. So a component using search params within a layout would be rerendering during client-side navigation, even if the layout doesn't.
Beta Was this translation helpful? Give feedback.
All reactions