@tanstack/react-router 0.0.1-beta.233 → 0.0.1-beta.235
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/Matches.js +18 -32
- package/build/cjs/Matches.js.map +1 -1
- package/build/cjs/RouterProvider.js +10 -18
- package/build/cjs/RouterProvider.js.map +1 -1
- package/build/cjs/index.js +0 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/route.js +7 -13
- package/build/cjs/route.js.map +1 -1
- package/build/cjs/useParams.js +2 -7
- package/build/cjs/useParams.js.map +1 -1
- package/build/cjs/useSearch.js +1 -6
- package/build/cjs/useSearch.js.map +1 -1
- package/build/cjs/utils.js +1 -4
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.js +40 -80
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +291 -291
- package/build/types/Matches.d.ts +3 -9
- package/build/types/RouterProvider.d.ts +0 -3
- package/build/types/route.d.ts +10 -30
- package/build/types/useParams.d.ts +1 -3
- package/build/types/useSearch.d.ts +1 -3
- package/build/types/utils.d.ts +1 -3
- package/build/umd/index.development.js +39 -80
- 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/Matches.tsx +37 -59
- package/src/RouterProvider.tsx +10 -20
- package/src/route.ts +15 -37
- package/src/useParams.tsx +4 -14
- package/src/useSearch.tsx +3 -11
- package/src/utils.ts +12 -20
package/build/types/Matches.d.ts
CHANGED
|
@@ -45,13 +45,7 @@ export type MakeMatchRouteOptions<TRouteTree extends AnyRoute = RegisteredRouter
|
|
|
45
45
|
children?: ((params?: RouteByPath<TRouteTree, ResolveRelativePath<TFrom, NoInfer<TTo>>>['types']['allParams']) => ReactNode) | React.ReactNode;
|
|
46
46
|
};
|
|
47
47
|
export declare function MatchRoute<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''>(props: MakeMatchRouteOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>): any;
|
|
48
|
-
export declare function useMatch<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TStrict extends boolean = true, TRouteMatchState = RouteMatch<TRouteTree, TFrom
|
|
49
|
-
select?: (match: TRouteMatchState) => TSelected;
|
|
50
|
-
}): TStrict extends true ? TSelected : TSelected | undefined;
|
|
48
|
+
export declare function useMatch<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TStrict extends boolean = true, TRouteMatchState = RouteMatch<TRouteTree, TFrom>>(opts: StrictOrFrom<TFrom>): TStrict extends true ? TRouteMatchState : TRouteMatchState | undefined;
|
|
51
49
|
export declare const matchesContext: React.Context<RouteMatch<AnyRoute, any>[]>;
|
|
52
|
-
export declare function useMatches
|
|
53
|
-
|
|
54
|
-
}): T;
|
|
55
|
-
export declare function useLoaderData<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TStrict extends boolean = true, TRouteMatch extends RouteMatch<TRouteTree, TFrom> = RouteMatch<TRouteTree, TFrom>, TSelected = TRouteMatch['loaderData']>(opts: StrictOrFrom<TFrom> & {
|
|
56
|
-
select?: (match: TRouteMatch) => TSelected;
|
|
57
|
-
}): TStrict extends true ? TSelected : TSelected | undefined;
|
|
50
|
+
export declare function useMatches(): RouteMatch[];
|
|
51
|
+
export declare function useLoaderData<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TStrict extends boolean = true, TRouteMatch extends RouteMatch<TRouteTree, TFrom> = RouteMatch<TRouteTree, TFrom>>(opts: StrictOrFrom<TFrom>): TStrict extends true ? TRouteMatch['loaderData'] : TRouteMatch['loaderData'] | undefined;
|
|
@@ -26,9 +26,6 @@ export type InjectedHtmlEntry = string | (() => Promise<string> | string);
|
|
|
26
26
|
export declare const routerContext: React.Context<Router<any, Record<string, any>>>;
|
|
27
27
|
export declare function RouterProvider<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TDehydrated extends Record<string, any> = Record<string, any>>({ router, ...rest }: RouterProps<TRouteTree, TDehydrated>): React.JSX.Element;
|
|
28
28
|
export declare function getRouteMatch<TRouteTree extends AnyRoute>(state: RouterState<TRouteTree>, id: string): undefined | RouteMatch<TRouteTree>;
|
|
29
|
-
export declare function useRouterState<TSelected = RouterState<RegisteredRouter['routeTree']>>(opts?: {
|
|
30
|
-
select: (state: RouterState<RegisteredRouter['routeTree']>) => TSelected;
|
|
31
|
-
}): TSelected;
|
|
32
29
|
export type RouterProps<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TDehydrated extends Record<string, any> = Record<string, any>> = Omit<RouterOptions<TRouteTree, TDehydrated>, 'context'> & {
|
|
33
30
|
router: Router<TRouteTree>;
|
|
34
31
|
context?: Partial<RouterOptions<TRouteTree, TDehydrated>['context']>;
|
package/build/types/route.d.ts
CHANGED
|
@@ -180,21 +180,11 @@ export declare class Route<TParentRoute extends RouteConstraints['TParentRoute']
|
|
|
180
180
|
addChildren: <TNewChildren extends AnyRoute[]>(children: TNewChildren) => Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TRouteContext, TAllContext, TRouterContext, TNewChildren, TRouteTree, AnyRoute>;
|
|
181
181
|
update: (options: UpdatableRouteOptions<TFullSearchSchema, TAllParams, Expand<Assign<IsAny<TParentRoute['types']['allContext'], {}>, TRouteContext>>, TLoaderData>) => this;
|
|
182
182
|
static __onInit: (route: any) => void;
|
|
183
|
-
useMatch:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
} | undefined) => TSelected;
|
|
189
|
-
useSearch: <TSelected = TFullSearchSchema>(opts?: {
|
|
190
|
-
select?: ((search: TFullSearchSchema) => TSelected) | undefined;
|
|
191
|
-
} | undefined) => TSelected;
|
|
192
|
-
useParams: <TSelected = TAllParams>(opts?: {
|
|
193
|
-
select?: ((search: TAllParams) => TSelected) | undefined;
|
|
194
|
-
} | undefined) => TSelected;
|
|
195
|
-
useLoaderData: <TSelected = TLoaderData>(opts?: {
|
|
196
|
-
select?: ((search: TLoaderData) => TSelected) | undefined;
|
|
197
|
-
} | undefined) => TSelected;
|
|
183
|
+
useMatch: () => TAllContext;
|
|
184
|
+
useRouteContext: () => TAllContext;
|
|
185
|
+
useSearch: () => TFullSearchSchema;
|
|
186
|
+
useParams: () => TAllParams;
|
|
187
|
+
useLoaderData: () => TLoaderData;
|
|
198
188
|
}
|
|
199
189
|
export type AnyRootRoute = RootRoute<any, any, any>;
|
|
200
190
|
export declare function rootRouteWithContext<TRouterContext extends {}>(): <TSearchSchema extends Record<string, any> = {}, TRouteContext extends RouteContext = RouteContext, TLoaderData extends unknown = unknown>(options?: Omit<RouteOptions<AnyRoute, "__root__", "", TSearchSchema, TSearchSchema, {}, {}, TRouteContext, Assign<TRouterContext, TRouteContext>, TLoaderData>, "path" | "id" | "getParentRoute" | "stringifyParams" | "parseParams" | "caseSensitive"> | undefined) => RootRoute<TSearchSchema, TRouteContext, TRouterContext, unknown>;
|
|
@@ -242,21 +232,11 @@ export declare function createRouteMask<TRouteTree extends AnyRoute, TFrom exten
|
|
|
242
232
|
routeTree: TRouteTree;
|
|
243
233
|
} & ToSubOptions<TRouteTree, TFrom, TTo>): RouteMask<TRouteTree>;
|
|
244
234
|
export type RouteProps<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TAllContext extends Record<string, any> = AnyContext, TLoaderData extends any = unknown> = {
|
|
245
|
-
useMatch:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}) => TSelected;
|
|
251
|
-
useSearch: <TSelected = TFullSearchSchema>(opts?: {
|
|
252
|
-
select?: (search: TFullSearchSchema) => TSelected;
|
|
253
|
-
}) => TSelected;
|
|
254
|
-
useParams: <TSelected = TAllParams>(opts?: {
|
|
255
|
-
select?: (search: TAllParams) => TSelected;
|
|
256
|
-
}) => TSelected;
|
|
257
|
-
useLoaderData: <TSelected = TLoaderData>(opts?: {
|
|
258
|
-
select?: (search: TLoaderData) => TSelected;
|
|
259
|
-
}) => TSelected;
|
|
235
|
+
useMatch: () => TAllContext;
|
|
236
|
+
useRouteContext: () => TAllContext;
|
|
237
|
+
useSearch: () => TFullSearchSchema;
|
|
238
|
+
useParams: () => TAllParams;
|
|
239
|
+
useLoaderData: () => TLoaderData;
|
|
260
240
|
};
|
|
261
241
|
export type ErrorRouteProps<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TAllContext extends Record<string, any> = AnyContext> = {
|
|
262
242
|
error: unknown;
|
|
@@ -2,6 +2,4 @@ import { AnyRoute } from './route';
|
|
|
2
2
|
import { RouteIds, RouteById, AllParams } from './routeInfo';
|
|
3
3
|
import { RegisteredRouter } from './router';
|
|
4
4
|
import { StrictOrFrom } from './utils';
|
|
5
|
-
export declare function useParams<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree
|
|
6
|
-
select?: (search: TDefaultSelected) => TSelected;
|
|
7
|
-
}): TSelected;
|
|
5
|
+
export declare function useParams<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>>(_opts: StrictOrFrom<TFrom>): AllParams<TRouteTree> & RouteById<TRouteTree, TFrom>['types']['allParams'];
|
|
@@ -2,6 +2,4 @@ import { AnyRoute } from './route';
|
|
|
2
2
|
import { RouteIds, RouteById } from './routeInfo';
|
|
3
3
|
import { RegisteredRouter } from './router';
|
|
4
4
|
import { StrictOrFrom } from './utils';
|
|
5
|
-
export declare function useSearch<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TStrict extends boolean = true, TSearch = RouteById<TRouteTree, TFrom>['types']['fullSearchSchema']
|
|
6
|
-
select?: (search: TSearch) => TSelected;
|
|
7
|
-
}): TStrict extends true ? TSelected : TSelected | undefined;
|
|
5
|
+
export declare function useSearch<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TStrict extends boolean = true, TSearch = RouteById<TRouteTree, TFrom>['types']['fullSearchSchema']>(opts: StrictOrFrom<TFrom>): TStrict extends true ? TSearch : TSearch | undefined;
|
package/build/types/utils.d.ts
CHANGED
|
@@ -59,8 +59,6 @@ export type StrictOrFrom<TFrom> = {
|
|
|
59
59
|
strict: false;
|
|
60
60
|
};
|
|
61
61
|
export type RouteFromIdOrRoute<T, TRouteTree extends AnyRoute = RegisteredRouter['routeTree']> = T extends ParseRoute<TRouteTree> ? T : T extends RouteIds<TRouteTree> ? RoutesById<TRouteTree>[T] : T extends string ? RouteIds<TRouteTree> : never;
|
|
62
|
-
export declare function useRouteContext<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TStrict extends boolean = true, TRouteContext = RouteById<TRouteTree, TFrom>['types']['allContext'], TSelected = TRouteContext>(opts: StrictOrFrom<TFrom>
|
|
63
|
-
select?: (search: TRouteContext) => TSelected;
|
|
64
|
-
}): TStrict extends true ? TSelected : TSelected | undefined;
|
|
62
|
+
export declare function useRouteContext<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TStrict extends boolean = true, TRouteContext = RouteById<TRouteTree, TFrom>['types']['allContext'], TSelected = TRouteContext>(opts: StrictOrFrom<TFrom>): TStrict extends true ? TSelected : TSelected | undefined;
|
|
65
63
|
export declare const useLayoutEffect: typeof React.useLayoutEffect;
|
|
66
64
|
export declare function escapeJSON(jsonString: string): string;
|
|
@@ -608,10 +608,7 @@
|
|
|
608
608
|
return true;
|
|
609
609
|
}
|
|
610
610
|
function useRouteContext(opts) {
|
|
611
|
-
return useMatch(
|
|
612
|
-
...opts,
|
|
613
|
-
select: match => opts?.select ? opts.select(match.context) : match.context
|
|
614
|
-
});
|
|
611
|
+
return useMatch(opts).context;
|
|
615
612
|
}
|
|
616
613
|
const useLayoutEffect$1 = typeof window !== 'undefined' ? React__namespace.useLayoutEffect : React__namespace.useEffect;
|
|
617
614
|
function escapeJSON(jsonString) {
|
|
@@ -804,22 +801,12 @@
|
|
|
804
801
|
return isMatch ? params : undefined;
|
|
805
802
|
}
|
|
806
803
|
|
|
807
|
-
function useParams(
|
|
808
|
-
return
|
|
809
|
-
select: state => {
|
|
810
|
-
const params = last(state.matches)?.params;
|
|
811
|
-
return opts?.select ? opts.select(params) : params;
|
|
812
|
-
}
|
|
813
|
-
});
|
|
804
|
+
function useParams(_opts) {
|
|
805
|
+
return last(useRouter().state.matches)?.params;
|
|
814
806
|
}
|
|
815
807
|
|
|
816
808
|
function useSearch(opts) {
|
|
817
|
-
return useMatch(
|
|
818
|
-
...opts,
|
|
819
|
-
select: match => {
|
|
820
|
-
return opts?.select ? opts.select(match.search) : match.search;
|
|
821
|
-
}
|
|
822
|
-
});
|
|
809
|
+
return useMatch(opts).search;
|
|
823
810
|
}
|
|
824
811
|
|
|
825
812
|
const rootRouteId = '__root__';
|
|
@@ -884,34 +871,28 @@
|
|
|
884
871
|
// This is a dummy static method that should get
|
|
885
872
|
// replaced by a framework specific implementation if necessary
|
|
886
873
|
};
|
|
887
|
-
useMatch =
|
|
874
|
+
useMatch = () => {
|
|
888
875
|
return useMatch({
|
|
889
|
-
...opts,
|
|
890
876
|
from: this.id
|
|
891
877
|
});
|
|
892
878
|
};
|
|
893
|
-
useRouteContext =
|
|
879
|
+
useRouteContext = () => {
|
|
894
880
|
return useMatch({
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
select: d => opts?.select ? opts.select(d.context) : d.context
|
|
898
|
-
});
|
|
881
|
+
from: this.id
|
|
882
|
+
}).context;
|
|
899
883
|
};
|
|
900
|
-
useSearch =
|
|
884
|
+
useSearch = () => {
|
|
901
885
|
return useSearch({
|
|
902
|
-
...opts,
|
|
903
886
|
from: this.id
|
|
904
887
|
});
|
|
905
888
|
};
|
|
906
|
-
useParams =
|
|
889
|
+
useParams = () => {
|
|
907
890
|
return useParams({
|
|
908
|
-
...opts,
|
|
909
891
|
from: this.id
|
|
910
892
|
});
|
|
911
893
|
};
|
|
912
|
-
useLoaderData =
|
|
894
|
+
useLoaderData = () => {
|
|
913
895
|
return useLoaderData({
|
|
914
|
-
...opts,
|
|
915
896
|
from: this.id
|
|
916
897
|
});
|
|
917
898
|
};
|
|
@@ -933,15 +914,12 @@
|
|
|
933
914
|
//
|
|
934
915
|
|
|
935
916
|
function Matches() {
|
|
936
|
-
const
|
|
937
|
-
routesById,
|
|
938
|
-
state
|
|
939
|
-
} = useRouter();
|
|
917
|
+
const router = useRouter();
|
|
940
918
|
const {
|
|
941
919
|
matches
|
|
942
|
-
} = state;
|
|
943
|
-
const locationKey =
|
|
944
|
-
const route = routesById[rootRouteId];
|
|
920
|
+
} = router.state;
|
|
921
|
+
const locationKey = router.state.location.state.key;
|
|
922
|
+
const route = router.routesById[rootRouteId];
|
|
945
923
|
const errorComponent = React__namespace.useCallback(props => {
|
|
946
924
|
return /*#__PURE__*/React__namespace.createElement(ErrorComponent, {
|
|
947
925
|
...props,
|
|
@@ -1081,42 +1059,31 @@
|
|
|
1081
1059
|
return !!params ? props.children : null;
|
|
1082
1060
|
}
|
|
1083
1061
|
function useMatch(opts) {
|
|
1062
|
+
const router = useRouter();
|
|
1084
1063
|
const nearestMatch = React__namespace.useContext(matchesContext)[0];
|
|
1085
1064
|
const nearestMatchRouteId = nearestMatch?.routeId;
|
|
1086
|
-
const matchRouteId =
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
}
|
|
1091
|
-
});
|
|
1065
|
+
const matchRouteId = (() => {
|
|
1066
|
+
const match = opts?.from ? router.state.matches.find(d => d.routeId === opts?.from) : router.state.matches.find(d => d.id === nearestMatch.id);
|
|
1067
|
+
return match.routeId;
|
|
1068
|
+
})();
|
|
1092
1069
|
if (opts?.strict ?? true) {
|
|
1093
1070
|
invariant(nearestMatchRouteId == matchRouteId, `useMatch("${matchRouteId}") is being called in a component that is meant to render the '${nearestMatchRouteId}' route. Did you mean to 'useMatch("${matchRouteId}", { strict: false })' or 'useRoute("${matchRouteId}")' instead?`);
|
|
1094
1071
|
}
|
|
1095
|
-
const matchSelection =
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
}
|
|
1101
|
-
});
|
|
1072
|
+
const matchSelection = (() => {
|
|
1073
|
+
const match = opts?.from ? router.state.matches.find(d => d.routeId === opts?.from) : router.state.matches.find(d => d.id === nearestMatch.id);
|
|
1074
|
+
invariant(match, `Could not find ${opts?.from ? `an active match from "${opts.from}"` : 'a nearest match!'}`);
|
|
1075
|
+
return match;
|
|
1076
|
+
})();
|
|
1102
1077
|
return matchSelection;
|
|
1103
1078
|
}
|
|
1104
1079
|
const matchesContext = /*#__PURE__*/React__namespace.createContext(null);
|
|
1105
|
-
function useMatches(
|
|
1080
|
+
function useMatches() {
|
|
1081
|
+
const router = useRouter();
|
|
1106
1082
|
const contextMatches = React__namespace.useContext(matchesContext);
|
|
1107
|
-
return
|
|
1108
|
-
select: state => {
|
|
1109
|
-
const matches = state.matches.slice(state.matches.findIndex(d => d.id === contextMatches[0]?.id));
|
|
1110
|
-
return opts?.select ? opts.select(matches) : matches;
|
|
1111
|
-
}
|
|
1112
|
-
});
|
|
1083
|
+
return router.state.matches.slice(router.state.matches.findIndex(d => d.id === contextMatches[0]?.id));
|
|
1113
1084
|
}
|
|
1114
1085
|
function useLoaderData(opts) {
|
|
1115
|
-
|
|
1116
|
-
...opts,
|
|
1117
|
-
select: undefined
|
|
1118
|
-
});
|
|
1119
|
-
return typeof opts.select === 'function' ? opts.select(match?.loaderData) : match?.loaderData;
|
|
1086
|
+
return useMatch(opts)?.loaderData;
|
|
1120
1087
|
}
|
|
1121
1088
|
|
|
1122
1089
|
const routerContext = /*#__PURE__*/React__namespace.createContext(null);
|
|
@@ -1160,20 +1127,20 @@
|
|
|
1160
1127
|
router.state = state;
|
|
1161
1128
|
router.startReactTransition = startReactTransition;
|
|
1162
1129
|
const tryLoad = () => {
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
});
|
|
1171
|
-
}
|
|
1130
|
+
startReactTransition(() => {
|
|
1131
|
+
try {
|
|
1132
|
+
router.load();
|
|
1133
|
+
} catch (err) {
|
|
1134
|
+
console.error(err);
|
|
1135
|
+
}
|
|
1136
|
+
});
|
|
1172
1137
|
};
|
|
1173
1138
|
useLayoutEffect$1(() => {
|
|
1174
1139
|
const unsub = router.history.subscribe(() => {
|
|
1175
1140
|
router.latestLocation = router.parseLocation(router.latestLocation);
|
|
1176
|
-
|
|
1141
|
+
if (state.location !== router.latestLocation) {
|
|
1142
|
+
tryLoad();
|
|
1143
|
+
}
|
|
1177
1144
|
});
|
|
1178
1145
|
const nextLocation = router.buildLocation({
|
|
1179
1146
|
search: true,
|
|
@@ -1218,13 +1185,6 @@
|
|
|
1218
1185
|
function getRouteMatch(state, id) {
|
|
1219
1186
|
return [...state.pendingMatches, ...state.matches].find(d => d.id === id);
|
|
1220
1187
|
}
|
|
1221
|
-
function useRouterState(opts) {
|
|
1222
|
-
const {
|
|
1223
|
-
state
|
|
1224
|
-
} = useRouter();
|
|
1225
|
-
// return useStore(router.__store, opts?.select as any)
|
|
1226
|
-
return opts?.select ? opts.select(state) : state;
|
|
1227
|
-
}
|
|
1228
1188
|
function useRouter() {
|
|
1229
1189
|
const resolvedContext = typeof document !== 'undefined' ? window.__TSR_ROUTER_CONTEXT__ || routerContext : routerContext;
|
|
1230
1190
|
const value = React__namespace.useContext(resolvedContext);
|
|
@@ -2922,7 +2882,6 @@
|
|
|
2922
2882
|
exports.useParams = useParams;
|
|
2923
2883
|
exports.useRouteContext = useRouteContext;
|
|
2924
2884
|
exports.useRouter = useRouter;
|
|
2925
|
-
exports.useRouterState = useRouterState;
|
|
2926
2885
|
exports.useScrollRestoration = useScrollRestoration;
|
|
2927
2886
|
exports.useSearch = useSearch;
|
|
2928
2887
|
exports.useStableCallback = useStableCallback;
|