@tanstack/router-core 1.157.8 → 1.157.9
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 +4 -1
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +4 -1
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +11 -6
package/dist/cjs/router.cjs
CHANGED
|
@@ -335,6 +335,7 @@ class RouterCore {
|
|
|
335
335
|
const interpolatedNextTo = path.interpolatePath({
|
|
336
336
|
path: nextTo,
|
|
337
337
|
params: nextParams,
|
|
338
|
+
decoder: this.pathParamsDecoder,
|
|
338
339
|
server: this.isServer
|
|
339
340
|
}).interpolatedPath;
|
|
340
341
|
const destMatchResult = this.getMatchedRoutes(interpolatedNextTo);
|
|
@@ -350,10 +351,12 @@ class RouterCore {
|
|
|
350
351
|
);
|
|
351
352
|
}
|
|
352
353
|
}
|
|
354
|
+
let changedParams = false;
|
|
353
355
|
if (Object.keys(nextParams).length > 0) {
|
|
354
356
|
for (const route of destRoutes) {
|
|
355
357
|
const fn = route.options.params?.stringify ?? route.options.stringifyParams;
|
|
356
358
|
if (fn) {
|
|
359
|
+
changedParams = true;
|
|
357
360
|
Object.assign(nextParams, fn(nextParams));
|
|
358
361
|
}
|
|
359
362
|
}
|
|
@@ -363,7 +366,7 @@ class RouterCore {
|
|
|
363
366
|
// This preserves the original parameter syntax including optional parameters
|
|
364
367
|
nextTo
|
|
365
368
|
) : utils.decodePath(
|
|
366
|
-
path.interpolatePath({
|
|
369
|
+
!changedParams ? interpolatedNextTo : path.interpolatePath({
|
|
367
370
|
path: nextTo,
|
|
368
371
|
params: nextParams,
|
|
369
372
|
decoder: this.pathParamsDecoder,
|