@tanstack/react-router 0.0.1-beta.189 → 0.0.1-beta.190
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/react.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +94 -94
- package/build/types/react.d.ts +2 -2
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/react.tsx +6 -10
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.190",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "tanstack/router",
|
|
7
7
|
"homepage": "https://tanstack.com/router",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"tiny-warning": "^1.0.3",
|
|
45
45
|
"@tanstack/react-store": "^0.0.1",
|
|
46
46
|
"@gisatcz/cross-package-react-context": "^0.2.0",
|
|
47
|
-
"@tanstack/router-core": "0.0.1-beta.
|
|
47
|
+
"@tanstack/router-core": "0.0.1-beta.190"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "rollup --config rollup.config.js"
|
package/src/react.tsx
CHANGED
|
@@ -914,13 +914,7 @@ export function useNavigate<
|
|
|
914
914
|
TMaskFrom extends RoutePaths<TRouteTree> = '/',
|
|
915
915
|
TMaskTo extends string = '',
|
|
916
916
|
>(
|
|
917
|
-
opts?: NavigateOptions<
|
|
918
|
-
RegisteredRouter['routeTree'],
|
|
919
|
-
TFrom,
|
|
920
|
-
TTo,
|
|
921
|
-
TMaskFrom,
|
|
922
|
-
TMaskTo
|
|
923
|
-
>,
|
|
917
|
+
opts?: NavigateOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>,
|
|
924
918
|
) => {
|
|
925
919
|
return router.navigate({ ...defaultOpts, ...(opts as any) })
|
|
926
920
|
},
|
|
@@ -928,16 +922,18 @@ export function useNavigate<
|
|
|
928
922
|
)
|
|
929
923
|
}
|
|
930
924
|
|
|
931
|
-
export function useMatchRoute
|
|
925
|
+
export function useMatchRoute<
|
|
926
|
+
TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],
|
|
927
|
+
>() {
|
|
932
928
|
const router = useRouter()
|
|
933
929
|
|
|
934
930
|
return React.useCallback(
|
|
935
931
|
<
|
|
936
|
-
TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],
|
|
937
932
|
TFrom extends RoutePaths<TRouteTree> = '/',
|
|
938
933
|
TTo extends string = '',
|
|
939
934
|
TMaskFrom extends RoutePaths<TRouteTree> = '/',
|
|
940
935
|
TMaskTo extends string = '',
|
|
936
|
+
TResolved extends string = ResolveRelativePath<TFrom, NoInfer<TTo>>,
|
|
941
937
|
>(
|
|
942
938
|
opts: MakeUseMatchRouteOptions<
|
|
943
939
|
TRouteTree,
|
|
@@ -946,7 +942,7 @@ export function useMatchRoute() {
|
|
|
946
942
|
TMaskFrom,
|
|
947
943
|
TMaskTo
|
|
948
944
|
>,
|
|
949
|
-
) => {
|
|
945
|
+
): false | RouteById<TRouteTree, TResolved>['types']['allParams'] => {
|
|
950
946
|
const { pending, caseSensitive, ...rest } = opts
|
|
951
947
|
|
|
952
948
|
return router.matchRoute(rest as any, {
|