@tanstack/react-router 0.0.1-beta.186 → 0.0.1-beta.188
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 +96 -96
- package/build/types/react.d.ts +2 -2
- package/build/umd/index.development.js +9 -3
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +4 -4
- 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.188",
|
|
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.188"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "rollup --config rollup.config.js"
|
package/src/react.tsx
CHANGED
|
@@ -907,13 +907,7 @@ export function useNavigate<
|
|
|
907
907
|
TMaskFrom extends RoutePaths<TRouteTree> = '/',
|
|
908
908
|
TMaskTo extends string = '',
|
|
909
909
|
>(
|
|
910
|
-
opts?: NavigateOptions<
|
|
911
|
-
RegisteredRouter['routeTree'],
|
|
912
|
-
TFrom,
|
|
913
|
-
TTo,
|
|
914
|
-
TMaskFrom,
|
|
915
|
-
TMaskTo
|
|
916
|
-
>,
|
|
910
|
+
opts?: NavigateOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>,
|
|
917
911
|
) => {
|
|
918
912
|
return router.navigate({ ...defaultOpts, ...(opts as any) })
|
|
919
913
|
},
|
|
@@ -921,16 +915,18 @@ export function useNavigate<
|
|
|
921
915
|
)
|
|
922
916
|
}
|
|
923
917
|
|
|
924
|
-
export function useMatchRoute
|
|
918
|
+
export function useMatchRoute<
|
|
919
|
+
TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],
|
|
920
|
+
>() {
|
|
925
921
|
const router = useRouter()
|
|
926
922
|
|
|
927
923
|
return React.useCallback(
|
|
928
924
|
<
|
|
929
|
-
TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],
|
|
930
925
|
TFrom extends RoutePaths<TRouteTree> = '/',
|
|
931
926
|
TTo extends string = '',
|
|
932
927
|
TMaskFrom extends RoutePaths<TRouteTree> = '/',
|
|
933
928
|
TMaskTo extends string = '',
|
|
929
|
+
TResolved extends string = ResolveRelativePath<TFrom, NoInfer<TTo>>,
|
|
934
930
|
>(
|
|
935
931
|
opts: MakeUseMatchRouteOptions<
|
|
936
932
|
TRouteTree,
|
|
@@ -939,7 +935,7 @@ export function useMatchRoute() {
|
|
|
939
935
|
TMaskFrom,
|
|
940
936
|
TMaskTo
|
|
941
937
|
>,
|
|
942
|
-
) => {
|
|
938
|
+
): false | RouteById<TRouteTree, TResolved>['types']['allParams'] => {
|
|
943
939
|
const { pending, caseSensitive, ...rest } = opts
|
|
944
940
|
|
|
945
941
|
return router.matchRoute(rest as any, {
|