@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.
@@ -879,6 +879,7 @@ class Router {
879
879
  const route = this.looseRoutesById[routeId];
880
880
  const pendingMs = route.options.pendingMs ?? this.options.defaultPendingMs;
881
881
  const shouldPending = !!(onReady && !this.isServer && !resolvePreload(matchId) && (route.options.loader || route.options.beforeLoad) && typeof pendingMs === "number" && pendingMs !== Infinity && (route.options.pendingComponent ?? this.options.defaultPendingComponent));
882
+ let executeBeforeLoad = true;
882
883
  if (
883
884
  // If we are in the middle of a load, either of these will be present
884
885
  // (not to be confused with `loadPromise`, which is always defined)
@@ -893,7 +894,9 @@ class Router {
893
894
  }, pendingMs);
894
895
  }
895
896
  await existingMatch.beforeLoadPromise;
896
- } else {
897
+ executeBeforeLoad = this.getMatch(matchId).status !== "success";
898
+ }
899
+ if (executeBeforeLoad) {
897
900
  try {
898
901
  updateMatch(matchId, (prev) => ({
899
902
  ...prev,