@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/router-core",
3
- "version": "1.157.8",
3
+ "version": "1.157.9",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
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
 
@@ -1833,11 +1834,13 @@ export class RouterCore<
1833
1834
  }
1834
1835
 
1835
1836
  // If there are any params, we need to stringify them
1837
+ let changedParams = false
1836
1838
  if (Object.keys(nextParams).length > 0) {
1837
1839
  for (const route of destRoutes) {
1838
1840
  const fn =
1839
1841
  route.options.params?.stringify ?? route.options.stringifyParams
1840
1842
  if (fn) {
1843
+ changedParams = true
1841
1844
  Object.assign(nextParams, fn(nextParams))
1842
1845
  }
1843
1846
  }
@@ -1848,12 +1851,14 @@ export class RouterCore<
1848
1851
  // This preserves the original parameter syntax including optional parameters
1849
1852
  nextTo
1850
1853
  : decodePath(
1851
- interpolatePath({
1852
- path: nextTo,
1853
- params: nextParams,
1854
- decoder: this.pathParamsDecoder,
1855
- server: this.isServer,
1856
- }).interpolatedPath,
1854
+ !changedParams
1855
+ ? interpolatedNextTo
1856
+ : interpolatePath({
1857
+ path: nextTo,
1858
+ params: nextParams,
1859
+ decoder: this.pathParamsDecoder,
1860
+ server: this.isServer,
1861
+ }).interpolatedPath,
1857
1862
  )
1858
1863
 
1859
1864
  // Resolve the next search