@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.
@@ -333,6 +333,7 @@ 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);
@@ -348,10 +349,12 @@ class RouterCore {
348
349
  );
349
350
  }
350
351
  }
352
+ let changedParams = false;
351
353
  if (Object.keys(nextParams).length > 0) {
352
354
  for (const route of destRoutes) {
353
355
  const fn = route.options.params?.stringify ?? route.options.stringifyParams;
354
356
  if (fn) {
357
+ changedParams = true;
355
358
  Object.assign(nextParams, fn(nextParams));
356
359
  }
357
360
  }
@@ -361,7 +364,7 @@ class RouterCore {
361
364
  // This preserves the original parameter syntax including optional parameters
362
365
  nextTo
363
366
  ) : decodePath(
364
- interpolatePath({
367
+ !changedParams ? interpolatedNextTo : interpolatePath({
365
368
  path: nextTo,
366
369
  params: nextParams,
367
370
  decoder: this.pathParamsDecoder,