@tanstack/react-router 1.5.2 → 1.5.4
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 -7
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +6 -7
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +353 -353
- package/build/umd/index.development.js +6 -7
- 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 +16 -10
|
@@ -2485,10 +2485,9 @@
|
|
|
2485
2485
|
};
|
|
2486
2486
|
buildLocation = opts => {
|
|
2487
2487
|
const build = (dest = {}, matches) => {
|
|
2488
|
-
const
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
const fromMatches = this.matchRoutes(from.pathname, fromSearch);
|
|
2488
|
+
const fromSearch = (this.state.pendingMatches || this.state.matches).reverse()[0]?.search || this.latestLocation.search;
|
|
2489
|
+
let pathname = this.resolvePathWithBase(dest.from ?? this.latestLocation.pathname, `${dest.to ?? ''}`);
|
|
2490
|
+
const fromMatches = this.matchRoutes(this.latestLocation.pathname, fromSearch);
|
|
2492
2491
|
const stayingMatches = matches?.filter(d => fromMatches?.find(e => e.routeId === d.routeId));
|
|
2493
2492
|
const prevParams = {
|
|
2494
2493
|
...last(fromMatches)?.params
|
|
@@ -2519,10 +2518,10 @@
|
|
|
2519
2518
|
const postFilteredSearch = postSearchFilters?.length ? postSearchFilters.reduce((prev, next) => next(prev), destSearch) : destSearch;
|
|
2520
2519
|
const search = replaceEqualDeep(fromSearch, postFilteredSearch);
|
|
2521
2520
|
const searchStr = this.options.stringifySearch(search);
|
|
2522
|
-
const hash = dest.hash === true ?
|
|
2521
|
+
const hash = dest.hash === true ? this.latestLocation.hash : dest.hash ? functionalUpdate(dest.hash, this.latestLocation.hash) : undefined;
|
|
2523
2522
|
const hashStr = hash ? `#${hash}` : '';
|
|
2524
|
-
let nextState = dest.state === true ?
|
|
2525
|
-
nextState = replaceEqualDeep(
|
|
2523
|
+
let nextState = dest.state === true ? this.latestLocation.state : dest.state ? functionalUpdate(dest.state, this.latestLocation.state) : this.latestLocation.state;
|
|
2524
|
+
nextState = replaceEqualDeep(this.latestLocation.state, nextState);
|
|
2526
2525
|
return {
|
|
2527
2526
|
pathname,
|
|
2528
2527
|
search,
|