@tanstack/react-router 1.52.1 → 1.52.2

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.
@@ -776,6 +776,7 @@ class Router {
776
776
  matchPromises.push(
777
777
  (async () => {
778
778
  const { loaderPromise: prevLoaderPromise } = this.getMatch(matchId);
779
+ let loaderRunningAsync = false;
779
780
  if (prevLoaderPromise) {
780
781
  await prevLoaderPromise;
781
782
  } else {
@@ -904,8 +905,9 @@ class Router {
904
905
  }
905
906
  };
906
907
  const { status, invalid } = this.getMatch(matchId);
908
+ loaderRunningAsync = status === "success" && (invalid || (shouldReload ?? age > staleAge));
907
909
  if (preload && route.options.preload === false) {
908
- } else if (status === "success" && (invalid || (shouldReload ?? age > staleAge))) {
910
+ } else if (loaderRunningAsync) {
909
911
  ;
910
912
  (async () => {
911
913
  try {
@@ -922,7 +924,7 @@ class Router {
922
924
  }
923
925
  updateMatch(matchId, (prev) => ({
924
926
  ...prev,
925
- isFetching: false,
927
+ isFetching: loaderRunningAsync ? prev.isFetching : false,
926
928
  loaderPromise: void 0
927
929
  }));
928
930
  })()