@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/package.json
CHANGED
package/src/router.ts
CHANGED
|
@@ -1805,6 +1805,7 @@ export class RouterCore<
|
|
|
1805
1805
|
const interpolatedNextTo = interpolatePath({
|
|
1806
1806
|
path: nextTo,
|
|
1807
1807
|
params: nextParams,
|
|
1808
|
+
decoder: this.pathParamsDecoder,
|
|
1808
1809
|
server: this.isServer,
|
|
1809
1810
|
}).interpolatedPath
|
|
1810
1811
|
|
|
@@ -1820,24 +1821,18 @@ export class RouterCore<
|
|
|
1820
1821
|
destMatchResult.routeParams['**']
|
|
1821
1822
|
: trimPathRight(interpolatedNextTo)
|
|
1822
1823
|
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
if (this.options.notFoundRoute) {
|
|
1826
|
-
destRoutes = [...destRoutes, this.options.notFoundRoute]
|
|
1827
|
-
} else {
|
|
1828
|
-
globalNotFoundRouteId = findGlobalNotFoundRouteId(
|
|
1829
|
-
this.options.notFoundMode,
|
|
1830
|
-
destRoutes,
|
|
1831
|
-
)
|
|
1832
|
-
}
|
|
1824
|
+
if (isGlobalNotFound && this.options.notFoundRoute) {
|
|
1825
|
+
destRoutes = [...destRoutes, this.options.notFoundRoute]
|
|
1833
1826
|
}
|
|
1834
1827
|
|
|
1835
1828
|
// If there are any params, we need to stringify them
|
|
1829
|
+
let changedParams = false
|
|
1836
1830
|
if (Object.keys(nextParams).length > 0) {
|
|
1837
1831
|
for (const route of destRoutes) {
|
|
1838
1832
|
const fn =
|
|
1839
1833
|
route.options.params?.stringify ?? route.options.stringifyParams
|
|
1840
1834
|
if (fn) {
|
|
1835
|
+
changedParams = true
|
|
1841
1836
|
Object.assign(nextParams, fn(nextParams))
|
|
1842
1837
|
}
|
|
1843
1838
|
}
|
|
@@ -1848,12 +1843,14 @@ export class RouterCore<
|
|
|
1848
1843
|
// This preserves the original parameter syntax including optional parameters
|
|
1849
1844
|
nextTo
|
|
1850
1845
|
: decodePath(
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1846
|
+
!changedParams
|
|
1847
|
+
? interpolatedNextTo
|
|
1848
|
+
: interpolatePath({
|
|
1849
|
+
path: nextTo,
|
|
1850
|
+
params: nextParams,
|
|
1851
|
+
decoder: this.pathParamsDecoder,
|
|
1852
|
+
server: this.isServer,
|
|
1853
|
+
}).interpolatedPath,
|
|
1857
1854
|
)
|
|
1858
1855
|
|
|
1859
1856
|
// Resolve the next search
|