@tanstack/router-core 1.157.8 → 1.157.10
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 -10
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +6 -10
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +13 -16
package/dist/esm/router.js
CHANGED
|
@@ -333,25 +333,21 @@ class RouterCore {
|
|
|
333
333
|
const interpolatedNextTo = interpolatePath({
|
|
334
334
|
path: nextTo,
|
|
335
335
|
params: nextParams,
|
|
336
|
+
decoder: this.pathParamsDecoder,
|
|
336
337
|
server: this.isServer
|
|
337
338
|
}).interpolatedPath;
|
|
338
339
|
const destMatchResult = this.getMatchedRoutes(interpolatedNextTo);
|
|
339
340
|
let destRoutes = destMatchResult.matchedRoutes;
|
|
340
341
|
const isGlobalNotFound = destMatchResult.foundRoute ? destMatchResult.foundRoute.path !== "/" && destMatchResult.routeParams["**"] : trimPathRight(interpolatedNextTo);
|
|
341
|
-
if (isGlobalNotFound) {
|
|
342
|
-
|
|
343
|
-
destRoutes = [...destRoutes, this.options.notFoundRoute];
|
|
344
|
-
} else {
|
|
345
|
-
findGlobalNotFoundRouteId(
|
|
346
|
-
this.options.notFoundMode,
|
|
347
|
-
destRoutes
|
|
348
|
-
);
|
|
349
|
-
}
|
|
342
|
+
if (isGlobalNotFound && this.options.notFoundRoute) {
|
|
343
|
+
destRoutes = [...destRoutes, this.options.notFoundRoute];
|
|
350
344
|
}
|
|
345
|
+
let changedParams = false;
|
|
351
346
|
if (Object.keys(nextParams).length > 0) {
|
|
352
347
|
for (const route of destRoutes) {
|
|
353
348
|
const fn = route.options.params?.stringify ?? route.options.stringifyParams;
|
|
354
349
|
if (fn) {
|
|
350
|
+
changedParams = true;
|
|
355
351
|
Object.assign(nextParams, fn(nextParams));
|
|
356
352
|
}
|
|
357
353
|
}
|
|
@@ -361,7 +357,7 @@ class RouterCore {
|
|
|
361
357
|
// This preserves the original parameter syntax including optional parameters
|
|
362
358
|
nextTo
|
|
363
359
|
) : decodePath(
|
|
364
|
-
interpolatePath({
|
|
360
|
+
!changedParams ? interpolatedNextTo : interpolatePath({
|
|
365
361
|
path: nextTo,
|
|
366
362
|
params: nextParams,
|
|
367
363
|
decoder: this.pathParamsDecoder,
|