Repository navigation
Conversation
buildBaseScenes reused the previous descriptor source whenever the route's child state was unchanged and its options were shallow-equal. That source's render closes over the route it was created with, so a params-only change (e.g. a deep link targeting a nested navigator) kept rendering the old route and the nested navigator never saw `params.screen`. Reuse the stable source only when the route itself is also shallow-equal. Fixes eds2002#158 Co-Authored-By: Claude Opus 5.5 <[email protected]>
✅ Deploy Preview for rnst-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Author
|
Reproduction for the bug this PR fixes (#158 was auto-closed and locked before I could add it): https://github.com/ptrnk0/screen-transitions-deeplink-repro Expo SDK 57 + Verified on an iOS simulator:
|
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.
Motivation
Fixes #158.
When only a BlankStack route's
paramschange,buildBaseSceneskeeps the previous descriptor source as long as the child state is unchanged and the options are shallow-equal (areDescriptorSourcesEquivalentcompares onlyoptions). The scene'srendercomes from that source, and React Navigation'srendercloses over the route it was created with — so the screen keeps rendering the old route.The most visible symptom is deep links: React Navigation delivers a link into a nested navigator as params on the parent route (
{ screen, params, ... }), and the nested navigator only reacts once it sees them. With a BlankStack in between it never does, so links into nested stacks silently stay on the current screen. Anynavigate/setParamsthat changes params of a mounted BlankStack screen without changing its options is affected the same way.Change
Reuse the stable descriptor source only when the route itself is also shallow-equal to the previous one. Params-only changes now take the fresh descriptor (and its
render); re-renders with an equivalent route keep the existing stability — the existing "skips state updates for fresh equivalent route descriptors" test still passes unchanged.Test plan
renders with the fresh descriptor when only route params changeinblank-stack-controller.test.ts— fails onmain, passes with this change.bun test— 477 pass, 0 failbun run lint— cleanbun run typecheck— cleanStackunder a BlankStack navigate correctly again. Not run: the Maestro e2e suite.🤖 Generated with Claude Code