react-router 7.7.1 → 7.8.0-pre.1
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/CHANGELOG.md +87 -5
- package/dist/development/browser-z32v5KVN.d.mts +46 -0
- package/dist/development/{chunk-R73PQUJU.js → chunk-4EVDZJGM.js} +130 -130
- package/dist/{production/chunk-K3SBCRK4.mjs → development/chunk-I22FVTOY.mjs} +177 -134
- package/dist/development/{chunk-K7YFBME3.js → chunk-NGF2R4G7.js} +285 -189
- package/dist/development/{chunk-C37GKA54.mjs → chunk-XFFANEXU.mjs} +266 -170
- package/dist/development/{components-CjQijYga.d.mts → components-CuPfnyiZ.d.mts} +33 -21
- package/dist/{production/route-data-CqEmXQub.d.mts → development/context-DohQKLID.d.mts} +312 -525
- package/dist/development/dom-export.d.mts +16 -12
- package/dist/development/dom-export.d.ts +13 -8
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- package/dist/development/{index-react-server-client-Bi_fx8qz.d.ts → index-react-server-client-BzBbJLAD.d.ts} +357 -219
- package/dist/{production/index-react-server-client-KLg-U4nr.d.mts → development/index-react-server-client-CuajY2vy.d.mts} +327 -200
- package/dist/development/index-react-server-client.d.mts +4 -3
- package/dist/development/index-react-server-client.d.ts +2 -2
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +291 -71
- package/dist/development/index-react-server.d.ts +291 -71
- package/dist/development/index-react-server.js +209 -182
- package/dist/development/index-react-server.mjs +209 -182
- package/dist/development/index.d.mts +294 -86
- package/dist/development/index.d.ts +136 -105
- package/dist/development/index.js +258 -215
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +13 -2
- package/dist/development/lib/types/internal.d.ts +12 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/route-data-CpB5xtMm.d.mts +473 -0
- package/dist/{production/routeModules-BR2FO0ix.d.ts → development/routeModules-qBivMBjd.d.ts} +325 -68
- package/dist/production/browser-z32v5KVN.d.mts +46 -0
- package/dist/production/{chunk-4DGLNKXF.js → chunk-4PESVXQ2.js} +130 -130
- package/dist/{development/chunk-KIUJAIYX.mjs → production/chunk-JJOMWYJ4.mjs} +177 -134
- package/dist/production/{chunk-IZ57JD2V.mjs → chunk-P2ZJHOXZ.mjs} +266 -170
- package/dist/production/{chunk-7OQROU2D.js → chunk-RLJ23MYZ.js} +285 -189
- package/dist/production/{components-CjQijYga.d.mts → components-CuPfnyiZ.d.mts} +33 -21
- package/dist/{development/route-data-CqEmXQub.d.mts → production/context-DohQKLID.d.mts} +312 -525
- package/dist/production/dom-export.d.mts +16 -12
- package/dist/production/dom-export.d.ts +13 -8
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- package/dist/production/{index-react-server-client-Bi_fx8qz.d.ts → index-react-server-client-BzBbJLAD.d.ts} +357 -219
- package/dist/{development/index-react-server-client-KLg-U4nr.d.mts → production/index-react-server-client-CuajY2vy.d.mts} +327 -200
- package/dist/production/index-react-server-client.d.mts +4 -3
- package/dist/production/index-react-server-client.d.ts +2 -2
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +291 -71
- package/dist/production/index-react-server.d.ts +291 -71
- package/dist/production/index-react-server.js +209 -182
- package/dist/production/index-react-server.mjs +209 -182
- package/dist/production/index.d.mts +294 -86
- package/dist/production/index.d.ts +136 -105
- package/dist/production/index.js +258 -215
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +13 -2
- package/dist/production/lib/types/internal.d.ts +12 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/route-data-CpB5xtMm.d.mts +473 -0
- package/dist/{development/routeModules-BR2FO0ix.d.ts → production/routeModules-qBivMBjd.d.ts} +325 -68
- package/package.json +1 -1
- package/dist/development/browser-7LYX59NK.d.mts +0 -226
- package/dist/production/browser-7LYX59NK.d.mts +0 -226
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as Router$1, I as InitialEntry, T as To, a as RelativeRoutingType, N as NonIndexRouteObject, L as LazyRouteFunction, b as IndexRouteObject, c as Location, A as Action, d as Navigator, e as RouterInit, F as FutureConfig, H as HydrationState, D as DataStrategyFunction, P as PatchRoutesOnNavigationFunction, f as RouteObject, g as RouteMatch, h as Params, U as UIMatch } from './
|
|
1
|
+
import { R as Router$1, I as InitialEntry, T as To, a as RelativeRoutingType, N as NonIndexRouteObject, L as LazyRouteFunction, b as IndexRouteObject, c as Location, A as Action, d as Navigator, e as RouterInit, F as FutureConfig, H as HydrationState, D as DataStrategyFunction, P as PatchRoutesOnNavigationFunction, f as RouteObject, g as RouteMatch, h as Params, U as UIMatch } from './context-DohQKLID.mjs';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
declare function mapRouteProperties(route: RouteObject): Partial<RouteObject> & {
|
|
@@ -14,8 +14,11 @@ interface MemoryRouterOpts {
|
|
|
14
14
|
*/
|
|
15
15
|
basename?: string;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* A function that returns an {@link unstable_RouterContextProvider} instance
|
|
18
|
+
* which is provided as the `context` argument to client [`action`](../../start/data/route-object#action)s,
|
|
19
|
+
* [`loader`](../../start/data/route-object#loader)s and [middleware](../../how-to/middleware).
|
|
20
|
+
* This function is called to generate a fresh `context` instance on each
|
|
21
|
+
* navigation or fetcher call.
|
|
19
22
|
*/
|
|
20
23
|
unstable_getContext?: RouterInit["unstable_getContext"];
|
|
21
24
|
/**
|
|
@@ -32,7 +35,7 @@ interface MemoryRouterOpts {
|
|
|
32
35
|
*/
|
|
33
36
|
initialEntries?: InitialEntry[];
|
|
34
37
|
/**
|
|
35
|
-
* Index of
|
|
38
|
+
* Index of `initialEntries` the application should initialize to
|
|
36
39
|
*/
|
|
37
40
|
initialIndex?: number;
|
|
38
41
|
/**
|
|
@@ -89,7 +92,7 @@ interface RouterProviderProps {
|
|
|
89
92
|
* Render the UI for the given {@link DataRouter}. This component should
|
|
90
93
|
* typically be at the top of an app's element tree.
|
|
91
94
|
*
|
|
92
|
-
*
|
|
95
|
+
* ```tsx
|
|
93
96
|
* import { createBrowserRouter } from "react-router";
|
|
94
97
|
* import { RouterProvider } from "react-router/dom";
|
|
95
98
|
* import { createRoot } from "react-dom/client";
|
|
@@ -98,6 +101,14 @@ interface RouterProviderProps {
|
|
|
98
101
|
* createRoot(document.getElementById("root")).render(
|
|
99
102
|
* <RouterProvider router={router} />
|
|
100
103
|
* );
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* <docs-info>Please note that this component is exported both from
|
|
107
|
+
* `react-router` and `react-router/dom` with the only difference being that the
|
|
108
|
+
* latter automatically wires up `react-dom`'s [`flushSync`](https://react.dev/reference/react-dom/flushSync)
|
|
109
|
+
* implementation. You _almost always_ want to use the version from
|
|
110
|
+
* `react-router/dom` unless you're running in a non-DOM environment.</docs-info>
|
|
111
|
+
*
|
|
101
112
|
*
|
|
102
113
|
* @public
|
|
103
114
|
* @category Data Routers
|
|
@@ -125,7 +136,7 @@ interface MemoryRouterProps {
|
|
|
125
136
|
*/
|
|
126
137
|
initialEntries?: InitialEntry[];
|
|
127
138
|
/**
|
|
128
|
-
* Index of
|
|
139
|
+
* Index of `initialEntries` the application should initialize to
|
|
129
140
|
*/
|
|
130
141
|
initialIndex?: number;
|
|
131
142
|
}
|
|
@@ -140,7 +151,8 @@ interface MemoryRouterProps {
|
|
|
140
151
|
* @param {MemoryRouterProps.children} props.children n/a
|
|
141
152
|
* @param {MemoryRouterProps.initialEntries} props.initialEntries n/a
|
|
142
153
|
* @param {MemoryRouterProps.initialIndex} props.initialIndex n/a
|
|
143
|
-
* @returns A declarative in
|
|
154
|
+
* @returns A declarative in-memory {@link Router | `<Router>`} for client-side
|
|
155
|
+
* routing.
|
|
144
156
|
*/
|
|
145
157
|
declare function MemoryRouter({ basename, children, initialEntries, initialIndex, }: MemoryRouterProps): React.ReactElement;
|
|
146
158
|
/**
|
|
@@ -161,7 +173,7 @@ interface NavigateProps {
|
|
|
161
173
|
*/
|
|
162
174
|
state?: any;
|
|
163
175
|
/**
|
|
164
|
-
* How to interpret relative routing in the
|
|
176
|
+
* How to interpret relative routing in the `to` prop.
|
|
165
177
|
* See {@link RelativeRoutingType}.
|
|
166
178
|
*/
|
|
167
179
|
relative?: RelativeRoutingType;
|
|
@@ -279,32 +291,32 @@ interface PathRouteProps {
|
|
|
279
291
|
children?: React.ReactNode;
|
|
280
292
|
/**
|
|
281
293
|
* The React element to render when this Route matches.
|
|
282
|
-
* Mutually exclusive with
|
|
294
|
+
* Mutually exclusive with `Component`.
|
|
283
295
|
*/
|
|
284
296
|
element?: React.ReactNode | null;
|
|
285
297
|
/**
|
|
286
298
|
* The React element to render while this router is loading data.
|
|
287
|
-
* Mutually exclusive with
|
|
299
|
+
* Mutually exclusive with `HydrateFallback`.
|
|
288
300
|
*/
|
|
289
301
|
hydrateFallbackElement?: React.ReactNode | null;
|
|
290
302
|
/**
|
|
291
303
|
* The React element to render at this route if an error occurs.
|
|
292
|
-
* Mutually exclusive with
|
|
304
|
+
* Mutually exclusive with `ErrorBoundary`.
|
|
293
305
|
*/
|
|
294
306
|
errorElement?: React.ReactNode | null;
|
|
295
307
|
/**
|
|
296
308
|
* The React Component to render when this route matches.
|
|
297
|
-
* Mutually exclusive with
|
|
309
|
+
* Mutually exclusive with `element`.
|
|
298
310
|
*/
|
|
299
311
|
Component?: React.ComponentType | null;
|
|
300
312
|
/**
|
|
301
313
|
* The React Component to render while this router is loading data.
|
|
302
|
-
* Mutually exclusive with
|
|
314
|
+
* Mutually exclusive with `hydrateFallbackElement`.
|
|
303
315
|
*/
|
|
304
316
|
HydrateFallback?: React.ComponentType | null;
|
|
305
317
|
/**
|
|
306
318
|
* The React Component to render at this route if an error occurs.
|
|
307
|
-
* Mutually exclusive with
|
|
319
|
+
* Mutually exclusive with `errorElement`.
|
|
308
320
|
*/
|
|
309
321
|
ErrorBoundary?: React.ComponentType | null;
|
|
310
322
|
}
|
|
@@ -366,32 +378,32 @@ interface IndexRouteProps {
|
|
|
366
378
|
children?: undefined;
|
|
367
379
|
/**
|
|
368
380
|
* The React element to render when this Route matches.
|
|
369
|
-
* Mutually exclusive with
|
|
381
|
+
* Mutually exclusive with `Component`.
|
|
370
382
|
*/
|
|
371
383
|
element?: React.ReactNode | null;
|
|
372
384
|
/**
|
|
373
385
|
* The React element to render while this router is loading data.
|
|
374
|
-
* Mutually exclusive with
|
|
386
|
+
* Mutually exclusive with `HydrateFallback`.
|
|
375
387
|
*/
|
|
376
388
|
hydrateFallbackElement?: React.ReactNode | null;
|
|
377
389
|
/**
|
|
378
390
|
* The React element to render at this route if an error occurs.
|
|
379
|
-
* Mutually exclusive with
|
|
391
|
+
* Mutually exclusive with `ErrorBoundary`.
|
|
380
392
|
*/
|
|
381
393
|
errorElement?: React.ReactNode | null;
|
|
382
394
|
/**
|
|
383
395
|
* The React Component to render when this route matches.
|
|
384
|
-
* Mutually exclusive with
|
|
396
|
+
* Mutually exclusive with `element`.
|
|
385
397
|
*/
|
|
386
398
|
Component?: React.ComponentType | null;
|
|
387
399
|
/**
|
|
388
400
|
* The React Component to render while this router is loading data.
|
|
389
|
-
* Mutually exclusive with
|
|
401
|
+
* Mutually exclusive with `hydrateFallbackElement`.
|
|
390
402
|
*/
|
|
391
403
|
HydrateFallback?: React.ComponentType | null;
|
|
392
404
|
/**
|
|
393
405
|
* The React Component to render at this route if an error occurs.
|
|
394
|
-
* Mutually exclusive with
|
|
406
|
+
* Mutually exclusive with `errorElement`.
|
|
395
407
|
*/
|
|
396
408
|
ErrorBoundary?: React.ComponentType | null;
|
|
397
409
|
}
|
|
@@ -471,7 +483,7 @@ interface RouterProps {
|
|
|
471
483
|
*/
|
|
472
484
|
location: Partial<Location> | string;
|
|
473
485
|
/**
|
|
474
|
-
* The type of navigation that triggered this location change.
|
|
486
|
+
* The type of navigation that triggered this `location` change.
|
|
475
487
|
* Defaults to {@link NavigationType.Pop}.
|
|
476
488
|
*/
|
|
477
489
|
navigationType?: Action;
|