@tanstack/react-router 1.57.17 → 1.57.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.
@@ -223,7 +223,7 @@ class Router {
223
223
  };
224
224
  this.buildLocation = (opts) => {
225
225
  const build = (dest = {}, matches) => {
226
- var _a, _b, _c, _d;
226
+ var _a, _b, _c, _d, _e;
227
227
  const fromMatches = dest._fromLocation ? this.matchRoutes(dest._fromLocation) : this.state.matches;
228
228
  const fromMatch = dest.from != null ? fromMatches.find(
229
229
  (d) => matchPathname(this.basepath, trimPathRight(d.pathname), {
@@ -237,16 +237,16 @@ class Router {
237
237
  dest.from == null || fromMatch != null,
238
238
  "Could not find match for from: " + dest.from
239
239
  );
240
- const fromSearch = this.state.pendingMatches ? (_a = last(this.state.pendingMatches)) == null ? void 0 : _a.search : ((_b = last(fromMatches)) == null ? void 0 : _b.search) || this.latestLocation.search;
240
+ const fromSearch = ((_a = this.state.pendingMatches) == null ? void 0 : _a.length) ? (_b = last(this.state.pendingMatches)) == null ? void 0 : _b.search : ((_c = last(fromMatches)) == null ? void 0 : _c.search) || this.latestLocation.search;
241
241
  const stayingMatches = matches == null ? void 0 : matches.filter(
242
242
  (d) => fromMatches.find((e) => e.routeId === d.routeId)
243
243
  );
244
- const fromRouteByFromPathRouteId = this.routesById[(_c = stayingMatches == null ? void 0 : stayingMatches.find((d) => d.pathname === fromPath)) == null ? void 0 : _c.routeId];
244
+ const fromRouteByFromPathRouteId = this.routesById[(_d = stayingMatches == null ? void 0 : stayingMatches.find((d) => d.pathname === fromPath)) == null ? void 0 : _d.routeId];
245
245
  let pathname = dest.to ? this.resolvePathWithBase(fromPath, `${dest.to}`) : this.resolvePathWithBase(
246
246
  fromPath,
247
247
  (fromRouteByFromPathRouteId == null ? void 0 : fromRouteByFromPathRouteId.to) ?? fromPath
248
248
  );
249
- const prevParams = { ...(_d = last(fromMatches)) == null ? void 0 : _d.params };
249
+ const prevParams = { ...(_e = last(fromMatches)) == null ? void 0 : _e.params };
250
250
  let nextParams = (dest.params ?? true) === true ? prevParams : { ...prevParams, ...functionalUpdate(dest.params, prevParams) };
251
251
  if (Object.keys(nextParams).length > 0) {
252
252
  matches == null ? void 0 : matches.map((d) => {