@tanstack/react-router 1.64.2 → 1.64.3
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/dist/cjs/RouterProvider.cjs.map +1 -1
- package/dist/cjs/RouterProvider.d.cts +1 -0
- package/dist/cjs/link.cjs +2 -2
- package/dist/cjs/link.cjs.map +1 -1
- package/dist/cjs/router.cjs +17 -2
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/RouterProvider.d.ts +1 -0
- package/dist/esm/RouterProvider.js.map +1 -1
- package/dist/esm/link.js +2 -2
- package/dist/esm/link.js.map +1 -1
- package/dist/esm/router.js +17 -2
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/RouterProvider.tsx +1 -0
- package/src/link.tsx +3 -2
- package/src/router.ts +21 -2
package/package.json
CHANGED
package/src/RouterProvider.tsx
CHANGED
package/src/link.tsx
CHANGED
|
@@ -757,8 +757,9 @@ export function useLinkProps<
|
|
|
757
757
|
})
|
|
758
758
|
|
|
759
759
|
// All is well? Navigate!
|
|
760
|
-
router.commitLocation(
|
|
761
|
-
|
|
760
|
+
// N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing
|
|
761
|
+
router.buildAndCommitLocation({
|
|
762
|
+
...options,
|
|
762
763
|
replace,
|
|
763
764
|
resetScroll,
|
|
764
765
|
startTransition,
|
package/src/router.ts
CHANGED
|
@@ -1460,8 +1460,24 @@ export class Router<
|
|
|
1460
1460
|
? postSearchFilters.reduce((prev, next) => next(prev), destSearch)
|
|
1461
1461
|
: destSearch
|
|
1462
1462
|
|
|
1463
|
-
|
|
1463
|
+
let search = postFilteredSearch
|
|
1464
1464
|
|
|
1465
|
+
if (opts._includeValidateSearch) {
|
|
1466
|
+
matchedRoutesResult?.matchedRoutes.forEach((route) => {
|
|
1467
|
+
try {
|
|
1468
|
+
if (route.options.validateSearch) {
|
|
1469
|
+
const validator =
|
|
1470
|
+
typeof route.options.validateSearch === 'object'
|
|
1471
|
+
? route.options.validateSearch.parse
|
|
1472
|
+
: route.options.validateSearch
|
|
1473
|
+
search = { ...search, ...validator(search) }
|
|
1474
|
+
}
|
|
1475
|
+
} catch (e) {
|
|
1476
|
+
// ignore errors here because they are already handled in matchRoutes
|
|
1477
|
+
}
|
|
1478
|
+
})
|
|
1479
|
+
}
|
|
1480
|
+
search = replaceEqualDeep(fromSearch, search)
|
|
1465
1481
|
const searchStr = this.options.stringifySearch(search)
|
|
1466
1482
|
|
|
1467
1483
|
const hash =
|
|
@@ -1644,7 +1660,10 @@ export class Router<
|
|
|
1644
1660
|
rest.hash = parsed.hash
|
|
1645
1661
|
}
|
|
1646
1662
|
|
|
1647
|
-
const location = this.buildLocation(
|
|
1663
|
+
const location = this.buildLocation({
|
|
1664
|
+
...(rest as any),
|
|
1665
|
+
_includeValidateSearch: true,
|
|
1666
|
+
})
|
|
1648
1667
|
return this.commitLocation({
|
|
1649
1668
|
...location,
|
|
1650
1669
|
viewTransition,
|