Unverified Commit 8cbabd39 authored by Damian Sowa's avatar Damian Sowa Committed by GitHub

Update 04-linking-and-navigating.mdx, Partial Rendering, explain about…

Update 04-linking-and-navigating.mdx, Partial Rendering, explain about unmounting and losing state (#70397)

### What?

Update 04-linking-and-navigating.mdx, 4. Partial Rendering section, add
information that rerenders of sibling routes mean full rerender of the
page, unmounting and losing the state of the page

### Why?
I've spent a lot of time trying to understand why in the app router when
switching between sibling routes (and Dynamic Segments) I lose scroll
position. Finally, find a discussion that this is the intentional
behaviour of the Next.js team. Would be good if the Next.js users could
find information in the documentation instead of searching for issues
and discussions in the documentation.

https://github.com/vercel/next.js/discussions/50711

### How?
Updated docs

---------
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 8a513eb4
......@@ -263,7 +263,7 @@ Learn more about how the [Router Cache](/docs/app/building-your-application/cach
Partial rendering means only the route segments that change on navigation re-render on the client, and any shared segments are preserved.
For example, when navigating between two sibling routes, `/dashboard/settings` and `/dashboard/analytics`, the `settings` and `analytics` pages will be rendered, and the shared `dashboard` layout will be preserved.
For example, when navigating between two sibling routes, `/dashboard/settings` and `/dashboard/analytics`, the `settings` page will be unmounted, the `analytics` page will be mounted with fresh state, and the shared `dashboard` layout will be preserved. This behavior is also present between two routes on the same dynamic segment e.g. with `/blog/[slug]/page` and navigating from `/blog/first` to `/blog/second`.
<Image
alt="How partial rendering works"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment