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