@tanstack/react-router 1.45.4 → 1.45.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/router.cjs +6 -7
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +6 -7
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +9 -18
package/src/router.ts
CHANGED
|
@@ -1147,22 +1147,13 @@ export class Router<
|
|
|
1147
1147
|
} = {},
|
|
1148
1148
|
matches?: Array<MakeRouteMatch<TRouteTree>>,
|
|
1149
1149
|
): ParsedLocation => {
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
? this.state.resolvedLocation
|
|
1158
|
-
: this.latestLocation
|
|
1159
|
-
|
|
1160
|
-
const location = dest._fromLocation ?? currentLocation
|
|
1161
|
-
|
|
1162
|
-
let fromPath = location.pathname
|
|
1163
|
-
let fromSearch = dest.fromSearch || location.search
|
|
1164
|
-
|
|
1165
|
-
const fromMatches = this.matchRoutes(location.pathname, fromSearch)
|
|
1150
|
+
const fromMatches =
|
|
1151
|
+
dest._fromLocation != null
|
|
1152
|
+
? this.matchRoutes(
|
|
1153
|
+
dest._fromLocation.pathname,
|
|
1154
|
+
dest.fromSearch || dest._fromLocation.search,
|
|
1155
|
+
)
|
|
1156
|
+
: this.state.matches
|
|
1166
1157
|
|
|
1167
1158
|
const fromMatch =
|
|
1168
1159
|
dest.from != null
|
|
@@ -1175,14 +1166,14 @@ export class Router<
|
|
|
1175
1166
|
)
|
|
1176
1167
|
: undefined
|
|
1177
1168
|
|
|
1178
|
-
fromPath = fromMatch?.pathname ||
|
|
1169
|
+
const fromPath = fromMatch?.pathname || this.latestLocation.pathname
|
|
1179
1170
|
|
|
1180
1171
|
invariant(
|
|
1181
1172
|
dest.from == null || fromMatch != null,
|
|
1182
1173
|
'Could not find match for from: ' + dest.from,
|
|
1183
1174
|
)
|
|
1184
1175
|
|
|
1185
|
-
fromSearch = last(fromMatches)?.search || this.latestLocation.search
|
|
1176
|
+
const fromSearch = last(fromMatches)?.search || this.latestLocation.search
|
|
1186
1177
|
|
|
1187
1178
|
const stayingMatches = matches?.filter((d) =>
|
|
1188
1179
|
fromMatches.find((e) => e.routeId === d.routeId),
|