@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.
@@ -561,6 +561,7 @@ export declare class RouterCore<in out TRouteTree extends AnyRoute, in out TTrai
561
561
  rewrite?: LocationRewrite;
562
562
  origin?: string;
563
563
  latestLocation: ParsedLocation<FullSearchSchema<TRouteTree>>;
564
+ pendingBuiltLocation?: ParsedLocation<FullSearchSchema<TRouteTree>>;
564
565
  basepath: string;
565
566
  routeTree: TRouteTree;
566
567
  routesById: RoutesById<TRouteTree>;
@@ -286,7 +286,7 @@ class RouterCore {
286
286
  };
287
287
  this.buildLocation = (opts) => {
288
288
  const build = (dest = {}) => {
289
- const currentLocation = dest._fromLocation || this.latestLocation;
289
+ const currentLocation = dest._fromLocation || this.pendingBuiltLocation || this.latestLocation;
290
290
  const allCurrentLocationMatches = this.matchRoutes(currentLocation, {
291
291
  _buildLocation: true
292
292
  });
@@ -524,7 +524,8 @@ class RouterCore {
524
524
  ...rest,
525
525
  _includeValidateSearch: true
526
526
  });
527
- return this.commitLocation({
527
+ this.pendingBuiltLocation = location;
528
+ const commitPromise = this.commitLocation({
528
529
  ...location,
529
530
  viewTransition,
530
531
  replace,
@@ -532,6 +533,12 @@ class RouterCore {
532
533
  hashScrollIntoView,
533
534
  ignoreBlocker
534
535
  });
536
+ Promise.resolve().then(() => {
537
+ if (this.pendingBuiltLocation === location) {
538
+ this.pendingBuiltLocation = void 0;
539
+ }
540
+ });
541
+ return commitPromise;
535
542
  };
536
543
  this.navigate = ({ to, reloadDocument, href, ...rest }) => {
537
544
  if (!reloadDocument && href) {