@tanstack/router-core 1.124.0 → 1.124.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.
@@ -232,9 +232,10 @@ class RouterCore {
232
232
  });
233
233
  const lastMatch = utils.last(allFromMatches);
234
234
  let fromPath = lastMatch.fullPath;
235
+ const routeIsChanging = !!dest.to && dest.to !== fromPath && this.resolvePathWithBase(fromPath, `${dest.to}`) !== fromPath;
235
236
  if (dest.unsafeRelative === "path") {
236
237
  fromPath = currentLocation.pathname;
237
- } else if (dest.to && dest.from) {
238
+ } else if (routeIsChanging && dest.from) {
238
239
  fromPath = dest.from;
239
240
  const existingFrom = [...allFromMatches].reverse().find((d) => {
240
241
  return d.fullPath === fromPath || d.fullPath === path.joinPaths([fromPath, "/"]);