@tanstack/router-core 1.134.15 → 1.134.18

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.
@@ -288,7 +288,7 @@ class RouterCore {
288
288
  };
289
289
  this.buildLocation = (opts) => {
290
290
  const build = (dest = {}) => {
291
- const currentLocation = dest._fromLocation || this.latestLocation;
291
+ const currentLocation = dest._fromLocation || this.pendingBuiltLocation || this.latestLocation;
292
292
  const allCurrentLocationMatches = this.matchRoutes(currentLocation, {
293
293
  _buildLocation: true
294
294
  });
@@ -526,7 +526,8 @@ class RouterCore {
526
526
  ...rest,
527
527
  _includeValidateSearch: true
528
528
  });
529
- return this.commitLocation({
529
+ this.pendingBuiltLocation = location;
530
+ const commitPromise = this.commitLocation({
530
531
  ...location,
531
532
  viewTransition,
532
533
  replace,
@@ -534,6 +535,12 @@ class RouterCore {
534
535
  hashScrollIntoView,
535
536
  ignoreBlocker
536
537
  });
538
+ Promise.resolve().then(() => {
539
+ if (this.pendingBuiltLocation === location) {
540
+ this.pendingBuiltLocation = void 0;
541
+ }
542
+ });
543
+ return commitPromise;
537
544
  };
538
545
  this.navigate = ({ to, reloadDocument, href, ...rest }) => {
539
546
  if (!reloadDocument && href) {