@tanstack/react-router 1.84.0 → 1.84.3
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/Matches.cjs.map +1 -1
- package/dist/cjs/Matches.d.cts +1 -1
- package/dist/cjs/Transitioner.cjs +9 -3
- package/dist/cjs/Transitioner.cjs.map +1 -1
- package/dist/cjs/route.cjs.map +1 -1
- package/dist/cjs/route.d.cts +6 -6
- package/dist/cjs/router.cjs +6 -3
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +5 -0
- package/dist/cjs/scroll-restoration.cjs +2 -2
- package/dist/cjs/scroll-restoration.cjs.map +1 -1
- package/dist/esm/Matches.d.ts +1 -1
- package/dist/esm/Matches.js.map +1 -1
- package/dist/esm/Transitioner.js +9 -3
- package/dist/esm/Transitioner.js.map +1 -1
- package/dist/esm/route.d.ts +6 -6
- package/dist/esm/route.js.map +1 -1
- package/dist/esm/router.d.ts +5 -0
- package/dist/esm/router.js +6 -3
- package/dist/esm/router.js.map +1 -1
- package/dist/esm/scroll-restoration.js +2 -2
- package/dist/esm/scroll-restoration.js.map +1 -1
- package/package.json +1 -1
- package/src/Matches.tsx +7 -7
- package/src/Transitioner.tsx +6 -0
- package/src/route.ts +29 -17
- package/src/router.ts +11 -3
- package/src/scroll-restoration.tsx +2 -2
package/dist/esm/router.js
CHANGED
|
@@ -620,7 +620,8 @@ class Router {
|
|
|
620
620
|
try {
|
|
621
621
|
const next = this.latestLocation;
|
|
622
622
|
const prevLocation = this.state.resolvedLocation;
|
|
623
|
-
const
|
|
623
|
+
const hrefChanged = prevLocation.href !== next.href;
|
|
624
|
+
const pathChanged = prevLocation.pathname !== next.pathname;
|
|
624
625
|
this.cancelMatches();
|
|
625
626
|
let pendingMatches;
|
|
626
627
|
this.__store.batch(() => {
|
|
@@ -642,14 +643,16 @@ class Router {
|
|
|
642
643
|
type: "onBeforeNavigate",
|
|
643
644
|
fromLocation: prevLocation,
|
|
644
645
|
toLocation: next,
|
|
645
|
-
pathChanged
|
|
646
|
+
pathChanged,
|
|
647
|
+
hrefChanged
|
|
646
648
|
});
|
|
647
649
|
}
|
|
648
650
|
this.emit({
|
|
649
651
|
type: "onBeforeLoad",
|
|
650
652
|
fromLocation: prevLocation,
|
|
651
653
|
toLocation: next,
|
|
652
|
-
pathChanged
|
|
654
|
+
pathChanged,
|
|
655
|
+
hrefChanged
|
|
653
656
|
});
|
|
654
657
|
await this.loadMatches({
|
|
655
658
|
matches: pendingMatches,
|