@tanstack/react-router 0.0.1-beta.254 → 0.0.1-beta.255
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 +4 -3
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +4 -3
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +355 -355
- package/build/umd/index.development.js +4 -3
- 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 +7 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-router",
|
|
3
3
|
"author": "Tanner Linsley",
|
|
4
|
-
"version": "0.0.1-beta.
|
|
4
|
+
"version": "0.0.1-beta.255",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "tanstack/router",
|
|
7
7
|
"homepage": "https://tanstack.com/router",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@tanstack/store": "^0.1.3",
|
|
45
45
|
"tiny-invariant": "^1.3.1",
|
|
46
46
|
"tiny-warning": "^1.0.3",
|
|
47
|
-
"@tanstack/history": "0.0.1-beta.
|
|
47
|
+
"@tanstack/history": "0.0.1-beta.255"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "rollup --config rollup.config.js"
|
package/src/router.ts
CHANGED
|
@@ -710,11 +710,14 @@ export class Router<
|
|
|
710
710
|
matches?: AnyRouteMatch[],
|
|
711
711
|
): ParsedLocation => {
|
|
712
712
|
const from = this.latestLocation
|
|
713
|
+
const fromSearch =
|
|
714
|
+
(this.state.pendingMatches || this.state.matches).at(-1)?.search ||
|
|
715
|
+
from.search
|
|
713
716
|
const fromPathname = dest.from ?? from.pathname
|
|
714
717
|
|
|
715
718
|
let pathname = this.resolvePathWithBase(fromPathname, `${dest.to ?? ''}`)
|
|
716
719
|
|
|
717
|
-
const fromMatches = this.matchRoutes(fromPathname,
|
|
720
|
+
const fromMatches = this.matchRoutes(fromPathname, fromSearch)
|
|
718
721
|
const stayingMatches = matches?.filter(
|
|
719
722
|
(d) => fromMatches?.find((e) => e.routeId === d.routeId),
|
|
720
723
|
)
|
|
@@ -761,9 +764,9 @@ export class Router<
|
|
|
761
764
|
const preFilteredSearch = preSearchFilters?.length
|
|
762
765
|
? preSearchFilters?.reduce(
|
|
763
766
|
(prev, next) => next(prev) as any,
|
|
764
|
-
|
|
767
|
+
fromSearch,
|
|
765
768
|
)
|
|
766
|
-
:
|
|
769
|
+
: fromSearch
|
|
767
770
|
|
|
768
771
|
// Then the link/navigate function
|
|
769
772
|
const destSearch =
|
|
@@ -780,7 +783,7 @@ export class Router<
|
|
|
780
783
|
? postSearchFilters.reduce((prev, next) => next(prev), destSearch)
|
|
781
784
|
: destSearch
|
|
782
785
|
|
|
783
|
-
const search = replaceEqualDeep(
|
|
786
|
+
const search = replaceEqualDeep(fromSearch, postFilteredSearch)
|
|
784
787
|
|
|
785
788
|
const searchStr = this.options.stringifySearch(search)
|
|
786
789
|
|