@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/esm/router.js
CHANGED
|
@@ -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 (
|
|
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, "/"]);
|