@tanstack/react-router 1.4.5 → 1.4.6
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/build/cjs/Matches.js.map +1 -1
- package/build/cjs/router.js +5 -2
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +5 -2
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +353 -353
- package/build/types/Matches.d.ts +1 -0
- package/build/umd/index.development.js +5 -2
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/Matches.tsx +1 -0
- package/src/router.ts +8 -1
package/build/esm/index.js
CHANGED
|
@@ -2105,6 +2105,8 @@ class Router {
|
|
|
2105
2105
|
handleErrorAndRedirect(match.searchError, 'VALIDATE_SEARCH');
|
|
2106
2106
|
}
|
|
2107
2107
|
const parentContext = parentMatch?.context ?? this.options.context ?? {};
|
|
2108
|
+
const pendingMs = route.options.pendingMs ?? this.options.defaultPendingMs;
|
|
2109
|
+
const pendingPromise = new Promise(r => setTimeout(r, pendingMs));
|
|
2108
2110
|
const beforeLoadContext = (await route.options.beforeLoad?.({
|
|
2109
2111
|
search: match.search,
|
|
2110
2112
|
abortController,
|
|
@@ -2131,7 +2133,8 @@ class Router {
|
|
|
2131
2133
|
...match,
|
|
2132
2134
|
routeContext: replaceEqualDeep(match.routeContext, beforeLoadContext),
|
|
2133
2135
|
context: replaceEqualDeep(match.context, context),
|
|
2134
|
-
abortController
|
|
2136
|
+
abortController,
|
|
2137
|
+
pendingPromise
|
|
2135
2138
|
};
|
|
2136
2139
|
} catch (err) {
|
|
2137
2140
|
handleErrorAndRedirect(err, 'BEFORE_LOAD');
|
|
@@ -2272,7 +2275,7 @@ class Router {
|
|
|
2272
2275
|
// If we need to potentially show the pending component,
|
|
2273
2276
|
// start a timer to show it after the pendingMs
|
|
2274
2277
|
if (shouldPending) {
|
|
2275
|
-
|
|
2278
|
+
match.pendingPromise?.then(async () => {
|
|
2276
2279
|
if (latestPromise = checkLatest()) return latestPromise;
|
|
2277
2280
|
didShowPending = true;
|
|
2278
2281
|
matches[index] = match = {
|