Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ShaneK
added this pull request to stack #31487
September 25, 2026 14:01
2 tasks
ShaneK
force-pushed
the
fix/rr6-route-bug
branch
from
September 25, 2026 14:01
fc334cc to
2f4be92
Compare
ShaneK
force-pushed
the
fix/rr6-route-bug
branch
from
September 25, 2026 15:09
2f4be92 to
a31edde
Compare
ShaneK
removed this pull request from stack #31487
September 25, 2026 15:54
thetaPC
approved these changes
Sep 25, 2026
Comment on lines
+1164
to
+1165
| isOverMatchingRoute(enteringViewItem.routeData?.childProps ?? {}) && | ||
| enteringRoute.props.path !== enteringViewItem.routeData?.childProps?.path |
Contributor
There was a problem hiding this comment.
These make the if statement large. Maybe consider making them into variables.
This branch was successfully deployed
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.
Issue number: resolves #31477
What is the current behavior?
Currently, an outlet holding a splat route alongside a more specific sibling loses the splat's page when you push that sibling. A splat matches every pathname, so
findViewItemshands back its view item for a pathname the sibling owns, andhandlePageTransitionthen overwrites that item'sreactElement, which swaps the page and unmounts it. Whatever was underneath, usually tabs or a nested outlet, is destroyed along with its state and scroll position.A root-level
/*has two further problems. Going back blanks the whole outlet, becausegetParentPathcaches an inferredoutletMountPathon the root outlet, which scopes it to whatever route was active and makes the next pathname look out of scope, sohandleOutOfScopeOutletaborts the transition and tears the outlet down. Swipe-to-go-back does nothing, because the deactivation scan inrenderViewItemre-appliesion-page-hiddenon the next render and undoesrevealIonPageForSwipeBack, leaving the user dragging a page withdisplay: none.What is the new behavior?
handlePageTransitionnow compares the view item it found againstfindRouteByRouteInfo, which is React Router's own ranking, and drops it when the two disagree so a fresh view item gets created for the winning route. The catch-all deactivation no longer unmounts a view that was pushed over, since hiding it is enough to keep it from rendering alongside the pushed page. A root outlet no longer caches a mount path, in both places that were doing it, because it is mounted under nothing and an inferred path only scopes it wrongly. The deactivation scan also skips whichever page a swipe gesture is currently revealing, tracked in aWeakSetthat is marked inonStartand cleared when the gesture ends.Does this introduce a breaking change?
Other information
New test pages:
Current Dev Build