@tanstack/react-router 0.0.1-beta.242 → 0.0.1-beta.244
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/link.js +4 -3
- package/build/cjs/link.js.map +1 -1
- package/build/cjs/useNavigate.js +4 -3
- package/build/cjs/useNavigate.js.map +1 -1
- package/build/esm/index.js +8 -6
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +357 -357
- package/build/umd/index.development.js +8 -6
- 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/link.tsx +3 -2
- package/src/useNavigate.tsx +3 -2
|
@@ -1610,8 +1610,9 @@
|
|
|
1610
1610
|
const {
|
|
1611
1611
|
buildLink
|
|
1612
1612
|
} = useRouter();
|
|
1613
|
-
const
|
|
1614
|
-
strict: false
|
|
1613
|
+
const matchPathname = useMatch({
|
|
1614
|
+
strict: false,
|
|
1615
|
+
select: s => s.pathname
|
|
1615
1616
|
});
|
|
1616
1617
|
const {
|
|
1617
1618
|
// custom props
|
|
@@ -1646,7 +1647,7 @@
|
|
|
1646
1647
|
...rest
|
|
1647
1648
|
} = options;
|
|
1648
1649
|
const linkInfo = buildLink({
|
|
1649
|
-
from: options.to ?
|
|
1650
|
+
from: options.to ? matchPathname : undefined,
|
|
1650
1651
|
...options
|
|
1651
1652
|
});
|
|
1652
1653
|
if (linkInfo.type === 'external') {
|
|
@@ -3110,12 +3111,13 @@
|
|
|
3110
3111
|
const {
|
|
3111
3112
|
navigate
|
|
3112
3113
|
} = useRouter();
|
|
3113
|
-
const
|
|
3114
|
-
strict: false
|
|
3114
|
+
const matchPathname = useMatch({
|
|
3115
|
+
strict: false,
|
|
3116
|
+
select: s => s.pathname
|
|
3115
3117
|
});
|
|
3116
3118
|
return React__namespace.useCallback(opts => {
|
|
3117
3119
|
return navigate({
|
|
3118
|
-
from: opts?.to ?
|
|
3120
|
+
from: opts?.to ? matchPathname : undefined,
|
|
3119
3121
|
...defaultOpts,
|
|
3120
3122
|
...opts
|
|
3121
3123
|
});
|