{{ message }}
Repository navigation
fix(app-router): keep shared layouts out of ancestor loading entries - #4132
Open
umeraamir69 wants to merge 3 commits into
Open
umeraamir69 wants to merge 3 commits into
umeraamir69 wants to merge 3 commits into
Conversation
An ancestor loading.tsx was wrapping the shared layout Flight record on every real navigation, so same-slug Link moves remounted a layout that should stay mounted. Leave that Suspense on the route entry instead.
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
<Link>moves under an ancestorloading.tsxwere remounting a shared layout that should stay mounted.#2940already refused the optimistic loading shell; the leftover remount was the real RSC payload wrapping that layout's own Flight entry in the ancestor Suspense.[slug]layout identity. Changing the slug still mints a new identity.Fixes #1523
This does not replace #3788. That PR rewrites where ancestor loading is placed and how it is keyed. This change only stops the layout Flight record from carrying that Suspense on a real navigation, which is what discarded the
layout-identityDOM node.Test plan
vp test run --project unit tests/app-page-route-wiring.test.ts tests/app-optimistic-routing.test.ts tests/navigation-planner.test.ts(158 passed)tests/e2e/cloudflare-workers/layout-identity.spec.tson the app-router-cloudflare Worker (existing fixture: parent, child, item, back, parallel slot, client state)loading.tsxstill shows the fallback while a slow child layout resolves[slug]value still remounts that layout