@tanstack/react-router 1.87.0 → 1.87.1
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 +4 -1
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +4 -1
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +5 -2
package/dist/esm/router.js
CHANGED
|
@@ -877,6 +877,7 @@ class Router {
|
|
|
877
877
|
const route = this.looseRoutesById[routeId];
|
|
878
878
|
const pendingMs = route.options.pendingMs ?? this.options.defaultPendingMs;
|
|
879
879
|
const shouldPending = !!(onReady && !this.isServer && !resolvePreload(matchId) && (route.options.loader || route.options.beforeLoad) && typeof pendingMs === "number" && pendingMs !== Infinity && (route.options.pendingComponent ?? this.options.defaultPendingComponent));
|
|
880
|
+
let executeBeforeLoad = true;
|
|
880
881
|
if (
|
|
881
882
|
// If we are in the middle of a load, either of these will be present
|
|
882
883
|
// (not to be confused with `loadPromise`, which is always defined)
|
|
@@ -891,7 +892,9 @@ class Router {
|
|
|
891
892
|
}, pendingMs);
|
|
892
893
|
}
|
|
893
894
|
await existingMatch.beforeLoadPromise;
|
|
894
|
-
|
|
895
|
+
executeBeforeLoad = this.getMatch(matchId).status !== "success";
|
|
896
|
+
}
|
|
897
|
+
if (executeBeforeLoad) {
|
|
895
898
|
try {
|
|
896
899
|
updateMatch(matchId, (prev) => ({
|
|
897
900
|
...prev,
|