@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/package.json
CHANGED
package/src/router.ts
CHANGED
|
@@ -2286,6 +2286,7 @@ export class Router<
|
|
|
2286
2286
|
this.options.defaultPendingComponent)
|
|
2287
2287
|
)
|
|
2288
2288
|
|
|
2289
|
+
let executeBeforeLoad = true
|
|
2289
2290
|
if (
|
|
2290
2291
|
// If we are in the middle of a load, either of these will be present
|
|
2291
2292
|
// (not to be confused with `loadPromise`, which is always defined)
|
|
@@ -2304,8 +2305,10 @@ export class Router<
|
|
|
2304
2305
|
|
|
2305
2306
|
// Wait for the beforeLoad to resolve before we continue
|
|
2306
2307
|
await existingMatch.beforeLoadPromise
|
|
2307
|
-
|
|
2308
|
-
|
|
2308
|
+
executeBeforeLoad = this.getMatch(matchId)!.status !== 'success'
|
|
2309
|
+
}
|
|
2310
|
+
if (executeBeforeLoad) {
|
|
2311
|
+
// If we are not in the middle of a load OR the previous load failed, start it
|
|
2309
2312
|
try {
|
|
2310
2313
|
updateMatch(matchId, (prev) => ({
|
|
2311
2314
|
...prev,
|