Replies: 2 comments 2 replies
|
There's a guide on canary about this: https://github.com/vercel/next.js/blob/canary/docs/01-app/02-guides/preserving-ui-state.mdx - just needs to be published to the live site - which should happen rather soon |
2 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.
Goals
cacheComponentsBackground
Based on the docs with
cacheComponents, routes are hidden via React<Activity>(state preserved) or fully unmounted (state lost) based on heuristics:Because state may or may not survive navigation, app authors lack a clear mental model for building pages safely:
Proposal
It would help if the docs clearly framed cached route state as a performance optimization (not a correctness guarantee) and provided guidance on patterns that are safe regardless of whether a route is hidden or unmounted.
Thanks!
All reactions