Skip to content
Source
Sign inSign up
TanStack/router

fix(react-router): implicit navigation for layout routes without a prefixed underscore id #1584

MergedSeanCassieremerged 6 commits intomain fromrefs/pull/1584/headmerged by SeanCassiere

Showing 4 changed files with 64 additions and 34 deletions (loading 1).

x
0 of 4 viewed, 4 left
6 additions and 9 deletionspackages/react-router/src/router.tsModified
View file
@@ -11,7 +11,6 @@
functionalUpdate,
last,
pick,
- removeLayoutSegments,
replaceEqualDeep,
} from './utils'
import { getRouteMatch } from './RouterProvider'
@@ -494,8 +493,7 @@
scores: Array<number>
}> = []
​
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
- const routes = Object.values(this.routesById) as Array<AnyRoute>
+ const routes: Array<AnyRoute> = Object.values(this.routesById)
​
routes.forEach((d, i) => {
if (d.isRoot || !d.path) {
@@ -937,17 +935,16 @@
fromMatches.find((e) => e.routeId === d.routeId),
​
- const fromRouteByFromPath = stayingMatches?.find(