@tanstack/router-core 1.162.1 → 1.162.2
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 +3 -11
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +3 -11
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +11 -23
package/dist/esm/router.js
CHANGED
|
@@ -346,26 +346,18 @@ class RouterCore {
|
|
|
346
346
|
fromParams,
|
|
347
347
|
functionalUpdate(dest.params, fromParams)
|
|
348
348
|
);
|
|
349
|
-
const
|
|
350
|
-
path: nextTo,
|
|
351
|
-
params: nextParams,
|
|
352
|
-
decoder: this.pathParamsDecoder,
|
|
353
|
-
server: this.isServer
|
|
354
|
-
}).interpolatedPath;
|
|
355
|
-
const destMatchResult = this.getMatchedRoutes(interpolatedNextTo);
|
|
349
|
+
const destMatchResult = this.getMatchedRoutes(nextTo);
|
|
356
350
|
let destRoutes = destMatchResult.matchedRoutes;
|
|
357
|
-
const isGlobalNotFound = destMatchResult.foundRoute
|
|
351
|
+
const isGlobalNotFound = !destMatchResult.foundRoute || destMatchResult.foundRoute.path !== "/" && destMatchResult.routeParams["**"];
|
|
358
352
|
if (isGlobalNotFound && this.options.notFoundRoute) {
|
|
359
353
|
destRoutes = [...destRoutes, this.options.notFoundRoute];
|
|
360
354
|
}
|
|
361
|
-
let changedParams = false;
|
|
362
355
|
if (Object.keys(nextParams).length > 0) {
|
|
363
356
|
for (const route of destRoutes) {
|
|
364
357
|
const fn = route.options.params?.stringify ?? route.options.stringifyParams;
|
|
365
358
|
if (fn) {
|
|
366
359
|
try {
|
|
367
360
|
Object.assign(nextParams, fn(nextParams));
|
|
368
|
-
changedParams = true;
|
|
369
361
|
} catch {
|
|
370
362
|
}
|
|
371
363
|
}
|
|
@@ -376,7 +368,7 @@ class RouterCore {
|
|
|
376
368
|
// This preserves the original parameter syntax including optional parameters
|
|
377
369
|
nextTo
|
|
378
370
|
) : decodePath(
|
|
379
|
-
|
|
371
|
+
interpolatePath({
|
|
380
372
|
path: nextTo,
|
|
381
373
|
params: nextParams,
|
|
382
374
|
decoder: this.pathParamsDecoder,
|