@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.
@@ -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 pendingPromise = new Promise(r => setTimeout(r, 1000));
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 (!preload && (route.options.pendingComponent ?? this.options.defaultPendingComponent) && (route.options.pendingMs ?? this.options.defaultPendingMs)) {
2231
+ if (pendingPromise) {
2229
2232
  pendingPromise.then(() => {
2230
2233
  didShowPending = true;
2231
2234
  matches[index] = match = {