@tanstack/react-router 0.0.1-beta.229 → 0.0.1-beta.230
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/router.js +6 -3
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +6 -3
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +281 -281
- package/build/umd/index.development.js +6 -3
- 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/router.ts +14 -8
|
@@ -1584,7 +1584,6 @@
|
|
|
1584
1584
|
warning(false, 'setState implementation is missing. If you see this, please file an issue.');
|
|
1585
1585
|
};
|
|
1586
1586
|
updateOptions = newOptions => {
|
|
1587
|
-
this.options;
|
|
1588
1587
|
this.options = {
|
|
1589
1588
|
...this.options,
|
|
1590
1589
|
...newOptions
|
|
@@ -2156,7 +2155,11 @@
|
|
|
2156
2155
|
invalid: false,
|
|
2157
2156
|
showPending: false
|
|
2158
2157
|
};
|
|
2159
|
-
const
|
|
2158
|
+
const pendingMs = route.options.pendingMs ?? this.options.defaultPendingMs;
|
|
2159
|
+
let pendingPromise;
|
|
2160
|
+
if (!preload && pendingMs && (route.options.pendingComponent ?? this.options.defaultPendingComponent)) {
|
|
2161
|
+
pendingPromise = new Promise(r => setTimeout(r, pendingMs));
|
|
2162
|
+
}
|
|
2160
2163
|
if (match.isFetching) {
|
|
2161
2164
|
loadPromise = getRouteMatch(this.state, match.id)?.loadPromise;
|
|
2162
2165
|
} else {
|
|
@@ -2225,7 +2228,7 @@
|
|
|
2225
2228
|
await new Promise(async resolve => {
|
|
2226
2229
|
// If the route has a pending component and a pendingMs option,
|
|
2227
2230
|
// forcefully show the pending component
|
|
2228
|
-
if (
|
|
2231
|
+
if (pendingPromise) {
|
|
2229
2232
|
pendingPromise.then(() => {
|
|
2230
2233
|
didShowPending = true;
|
|
2231
2234
|
matches[index] = match = {
|