@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.
@@ -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
- } else {
895
+ executeBeforeLoad = this.getMatch(matchId).status !== "success";
896
+ }
897
+ if (executeBeforeLoad) {
895
898
  try {
896
899
  updateMatch(matchId, (prev) => ({
897
900
  ...prev,