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