@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
- "version": "1.87.0",
3
+ "version": "1.87.1",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
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
- } else {
2308
- // If we are not in the middle of a load, start it
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,