Skip to content

Commit 6a08757

Browse files
authored
Organize imports (#10777)
1 parent f660702 commit 6a08757

File tree

8 files changed

+135
-137
lines changed

8 files changed

+135
-137
lines changed

packages/react-router-dom-v5-compat/index.ts

Lines changed: 65 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -47,42 +47,10 @@
4747
* deprecate the deep require if we wanted to avoid the duplication here.
4848
*/
4949
export type {
50-
BrowserRouterProps,
51-
Hash,
52-
HashRouterProps,
53-
HistoryRouterProps,
54-
LinkProps,
55-
Location,
56-
Path,
57-
To,
58-
MemoryRouterProps,
59-
NavigateFunction,
60-
NavigateOptions,
61-
NavigateProps,
62-
Navigator,
63-
NavLinkProps,
64-
OutletProps,
65-
Params,
66-
ParamParseKey,
67-
PathMatch,
68-
RouteMatch,
69-
RouteObject,
70-
RouteProps,
71-
PathRouteProps,
72-
LayoutRouteProps,
73-
IndexRouteProps,
74-
RouterProps,
75-
Pathname,
76-
Search,
77-
RoutesProps,
78-
ParamKeyValuePair,
79-
URLSearchParamsInit,
80-
// New stuff from RR 6.4
8150
ActionFunction,
8251
ActionFunctionArgs,
8352
AwaitProps,
84-
unstable_Blocker,
85-
unstable_BlockerFunction,
53+
BrowserRouterProps,
8654
DataRouteMatch,
8755
DataRouteObject,
8856
Fetcher,
@@ -91,23 +59,57 @@ export type {
9159
FormMethod,
9260
FormProps,
9361
GetScrollRestorationKeyFunction,
62+
Hash,
63+
HashRouterProps,
64+
HistoryRouterProps,
9465
IndexRouteObject,
66+
IndexRouteProps,
9567
JsonFunction,
68+
LayoutRouteProps,
69+
LinkProps,
9670
LoaderFunction,
9771
LoaderFunctionArgs,
72+
Location,
73+
MemoryRouterProps,
74+
NavLinkProps,
75+
NavigateFunction,
76+
NavigateOptions,
77+
NavigateProps,
9878
Navigation,
79+
Navigator,
9980
NonIndexRouteObject,
81+
OutletProps,
82+
ParamKeyValuePair,
83+
ParamParseKey,
84+
Params,
85+
Path,
86+
PathMatch,
10087
PathPattern,
88+
PathRouteProps,
89+
Pathname,
10190
RedirectFunction,
10291
RelativeRoutingType,
92+
RouteMatch,
93+
RouteObject,
94+
RouteProps,
95+
RouterProps,
10396
RouterProviderProps,
97+
RoutesProps,
10498
ScrollRestorationProps,
99+
Search,
105100
ShouldRevalidateFunction,
106101
SubmitFunction,
107102
SubmitOptions,
103+
To,
104+
URLSearchParamsInit,
105+
unstable_Blocker,
106+
unstable_BlockerFunction,
108107
} from "./react-router-dom";
109108
export {
109+
AbortedDeferredError,
110+
Await,
110111
BrowserRouter,
112+
Form,
111113
HashRouter,
112114
Link,
113115
MemoryRouter,
@@ -117,69 +119,65 @@ export {
117119
Outlet,
118120
Route,
119121
Router,
122+
RouterProvider,
120123
Routes,
124+
ScrollRestoration,
125+
UNSAFE_DataRouterContext,
126+
UNSAFE_DataRouterStateContext,
121127
UNSAFE_LocationContext,
122128
UNSAFE_NavigationContext,
123129
UNSAFE_RouteContext,
130+
UNSAFE_useRouteId,
131+
UNSAFE_useScrollRestoration,
132+
createBrowserRouter,
133+
createHashRouter,
134+
createMemoryRouter,
124135
createPath,
125136
createRoutesFromChildren,
137+
createRoutesFromElements,
126138
createSearchParams,
139+
defer,
127140
generatePath,
141+
isRouteErrorResponse,
142+
json,
128143
matchPath,
129144
matchRoutes,
130145
parsePath,
146+
redirect,
147+
redirectDocument,
131148
renderMatches,
132149
resolvePath,
133150
unstable_HistoryRouter,
151+
unstable_useBlocker,
152+
unstable_usePrompt,
153+
useActionData,
154+
useAsyncError,
155+
useAsyncValue,
156+
useBeforeUnload,
157+
useFetcher,
158+
useFetchers,
159+
useFormAction,
134160
useHref,
135161
useInRouterContext,
136162
useLinkClickHandler,
163+
useLoaderData,
137164
useLocation,
138165
useMatch,
166+
useMatches,
139167
useNavigate,
168+
useNavigation,
140169
useNavigationType,
141170
useOutlet,
142171
useOutletContext,
143172
useParams,
144173
useResolvedPath,
145-
useRoutes,
146-
useSearchParams,
147-
// New stuff from 6.4
148-
AbortedDeferredError,
149-
Await,
150-
RouterProvider,
151-
ScrollRestoration,
152-
createBrowserRouter,
153-
createHashRouter,
154-
createMemoryRouter,
155-
createRoutesFromElements,
156-
defer,
157-
isRouteErrorResponse,
158-
Form,
159-
json,
160-
redirect,
161-
redirectDocument,
162-
useActionData,
163-
useAsyncError,
164-
useAsyncValue,
165-
useBeforeUnload,
166-
unstable_useBlocker,
167-
useFetcher,
168-
useFetchers,
169-
useFormAction,
170-
useLoaderData,
171-
useMatches,
172-
useNavigation,
173-
unstable_usePrompt,
174174
useRevalidator,
175175
useRouteError,
176176
useRouteLoaderData,
177+
useRoutes,
178+
useSearchParams,
177179
useSubmit,
178-
UNSAFE_DataRouterContext,
179-
UNSAFE_DataRouterStateContext,
180-
UNSAFE_useScrollRestoration,
181-
UNSAFE_useRouteId,
182180
} from "./react-router-dom";
183181

184182
export type { StaticRouterProps } from "./lib/components";
185-
export { CompatRouter, CompatRoute, StaticRouter } from "./lib/components";
183+
export { CompatRoute, CompatRouter, StaticRouter } from "./lib/components";

packages/react-router/index.ts

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ import type {
66
BlockerFunction,
77
Fetcher,
88
HydrationState,
9+
InitialEntry,
910
JsonFunction,
11+
LazyRouteFunction,
1012
LoaderFunction,
1113
LoaderFunctionArgs,
1214
Location,
1315
Navigation,
14-
Params,
1516
ParamParseKey,
17+
Params,
1618
Path,
1719
PathMatch,
1820
PathPattern,
1921
RedirectFunction,
2022
RelativeRoutingType,
2123
Router as RemixRouter,
24+
FutureConfig as RouterFutureConfig,
2225
ShouldRevalidateFunction,
2326
To,
24-
InitialEntry,
25-
LazyRouteFunction,
26-
FutureConfig as RouterFutureConfig,
2727
} from "@remix-run/router";
2828
import {
2929
AbortedDeferredError,
@@ -46,21 +46,19 @@ import {
4646

4747
import type {
4848
AwaitProps,
49+
FutureConfig,
50+
IndexRouteProps,
51+
LayoutRouteProps,
4952
MemoryRouterProps,
5053
NavigateProps,
5154
OutletProps,
52-
RouteProps,
5355
PathRouteProps,
54-
LayoutRouteProps,
55-
IndexRouteProps,
56+
RouteProps,
5657
RouterProps,
57-
RoutesProps,
5858
RouterProviderProps,
59-
FutureConfig,
59+
RoutesProps,
6060
} from "./lib/components";
6161
import {
62-
createRoutesFromChildren,
63-
renderMatches,
6462
Await,
6563
MemoryRouter,
6664
Navigate,
@@ -69,13 +67,15 @@ import {
6967
Router,
7068
RouterProvider,
7169
Routes,
70+
createRoutesFromChildren,
71+
renderMatches,
7272
} from "./lib/components";
7373
import type {
7474
DataRouteMatch,
7575
DataRouteObject,
7676
IndexRouteObject,
77-
Navigator,
7877
NavigateOptions,
78+
Navigator,
7979
NonIndexRouteObject,
8080
RouteMatch,
8181
RouteObject,
@@ -89,28 +89,28 @@ import {
8989
} from "./lib/context";
9090
import type { NavigateFunction } from "./lib/hooks";
9191
import {
92+
useActionData,
93+
useAsyncError,
94+
useAsyncValue,
9295
useBlocker,
9396
useHref,
9497
useInRouterContext,
98+
useLoaderData,
9599
useLocation,
96100
useMatch,
97-
useNavigationType,
101+
useMatches,
98102
useNavigate,
103+
useNavigation,
104+
useNavigationType,
99105
useOutlet,
100106
useOutletContext,
101107
useParams,
102108
useResolvedPath,
103-
useRoutes,
104-
useActionData,
105-
useAsyncError,
106-
useAsyncValue,
107-
useRouteId,
108-
useLoaderData,
109-
useMatches,
110-
useNavigation,
111109
useRevalidator,
112110
useRouteError,
111+
useRouteId,
113112
useRouteLoaderData,
113+
useRoutes,
114114
useRoutesImpl,
115115
} from "./lib/hooks";
116116

@@ -124,8 +124,6 @@ export type {
124124
ActionFunction,
125125
ActionFunctionArgs,
126126
AwaitProps,
127-
Blocker as unstable_Blocker,
128-
BlockerFunction as unstable_BlockerFunction,
129127
DataRouteMatch,
130128
DataRouteObject,
131129
Fetcher,
@@ -134,8 +132,8 @@ export type {
134132
IndexRouteObject,
135133
IndexRouteProps,
136134
JsonFunction,
137-
LazyRouteFunction,
138135
LayoutRouteProps,
136+
LazyRouteFunction,
139137
LoaderFunction,
140138
LoaderFunctionArgs,
141139
Location,
@@ -147,13 +145,13 @@ export type {
147145
Navigator,
148146
NonIndexRouteObject,
149147
OutletProps,
150-
Params,
151148
ParamParseKey,
149+
Params,
152150
Path,
153151
PathMatch,
154-
Pathname,
155152
PathPattern,
156153
PathRouteProps,
154+
Pathname,
157155
RedirectFunction,
158156
RelativeRoutingType,
159157
RouteMatch,
@@ -165,6 +163,8 @@ export type {
165163
Search,
166164
ShouldRevalidateFunction,
167165
To,
166+
Blocker as unstable_Blocker,
167+
BlockerFunction as unstable_BlockerFunction,
168168
};
169169
export {
170170
AbortedDeferredError,
@@ -181,8 +181,8 @@ export {
181181
createRoutesFromChildren,
182182
createRoutesFromChildren as createRoutesFromElements,
183183
defer,
184-
isRouteErrorResponse,
185184
generatePath,
185+
isRouteErrorResponse,
186186
json,
187187
matchPath,
188188
matchRoutes,
@@ -191,10 +191,10 @@ export {
191191
redirectDocument,
192192
renderMatches,
193193
resolvePath,
194+
useBlocker as unstable_useBlocker,
194195
useActionData,
195196
useAsyncError,
196197
useAsyncValue,
197-
useBlocker as unstable_useBlocker,
198198
useHref,
199199
useInRouterContext,
200200
useLoaderData,
@@ -297,11 +297,11 @@ export function createMemoryRouter(
297297

298298
/** @internal */
299299
export {
300-
NavigationContext as UNSAFE_NavigationContext,
301-
LocationContext as UNSAFE_LocationContext,
302-
RouteContext as UNSAFE_RouteContext,
303300
DataRouterContext as UNSAFE_DataRouterContext,
304301
DataRouterStateContext as UNSAFE_DataRouterStateContext,
302+
LocationContext as UNSAFE_LocationContext,
303+
NavigationContext as UNSAFE_NavigationContext,
304+
RouteContext as UNSAFE_RouteContext,
305305
mapRouteProperties as UNSAFE_mapRouteProperties,
306306
useRouteId as UNSAFE_useRouteId,
307307
useRoutesImpl as UNSAFE_useRoutesImpl,

0 commit comments

Comments
 (0)