@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.
- package/dist/cjs/router.cjs +4 -2
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +4 -2
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +6 -7
package/dist/cjs/router.cjs
CHANGED
|
@@ -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 (
|
|
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
|
})()
|