@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.
- package/dist/cjs/router.cjs +2 -1
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +2 -1
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +9 -3
package/dist/cjs/router.cjs
CHANGED
|
@@ -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 (
|
|
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, "/"]);
|