react-router 0.0.0-experimental-aecfb0db1 → 0.0.0-experimental-e6fb6e074

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +18 -753
  2. package/README.md +14 -5
  3. package/dist/index.d.ts +30 -0
  4. package/dist/index.js +1501 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/components.d.ts +157 -0
  7. package/dist/lib/context.d.ts +102 -0
  8. package/dist/lib/deprecations.d.ts +4 -0
  9. package/dist/lib/hooks.d.ts +181 -0
  10. package/dist/main.js +19 -0
  11. package/dist/react-router.development.js +1397 -0
  12. package/dist/react-router.development.js.map +1 -0
  13. package/dist/react-router.production.min.js +12 -0
  14. package/dist/react-router.production.min.js.map +1 -0
  15. package/dist/umd/react-router.development.js +1624 -0
  16. package/dist/umd/react-router.development.js.map +1 -0
  17. package/dist/umd/react-router.production.min.js +12 -0
  18. package/dist/umd/react-router.production.min.js.map +1 -0
  19. package/package.json +9 -82
  20. package/dist/development/chunk-RXFCVJK2.mjs +0 -11495
  21. package/dist/development/dom-export.d.mts +0 -23
  22. package/dist/development/dom-export.d.ts +0 -22
  23. package/dist/development/dom-export.js +0 -246
  24. package/dist/development/dom-export.mjs +0 -225
  25. package/dist/development/index.d.mts +0 -800
  26. package/dist/development/index.d.ts +0 -2530
  27. package/dist/development/index.js +0 -11645
  28. package/dist/development/index.mjs +0 -246
  29. package/dist/development/lib/types/route-module.d.mts +0 -208
  30. package/dist/development/lib/types/route-module.d.ts +0 -208
  31. package/dist/development/lib/types/route-module.js +0 -28
  32. package/dist/development/lib/types/route-module.mjs +0 -10
  33. package/dist/development/lib-BJBhVBWN.d.mts +0 -1736
  34. package/dist/development/route-data-BmDen1H_.d.mts +0 -1749
  35. package/dist/development/route-data-fNWkI-4T.d.ts +0 -1749
  36. package/dist/production/chunk-TLRBG5AD.mjs +0 -11495
  37. package/dist/production/dom-export.d.mts +0 -23
  38. package/dist/production/dom-export.d.ts +0 -22
  39. package/dist/production/dom-export.js +0 -246
  40. package/dist/production/dom-export.mjs +0 -225
  41. package/dist/production/index.d.mts +0 -800
  42. package/dist/production/index.d.ts +0 -2530
  43. package/dist/production/index.js +0 -11645
  44. package/dist/production/index.mjs +0 -246
  45. package/dist/production/lib/types/route-module.d.mts +0 -208
  46. package/dist/production/lib/types/route-module.d.ts +0 -208
  47. package/dist/production/lib/types/route-module.js +0 -28
  48. package/dist/production/lib/types/route-module.mjs +0 -10
  49. package/dist/production/lib-BJBhVBWN.d.mts +0 -1736
  50. package/dist/production/route-data-BmDen1H_.d.mts +0 -1749
  51. package/dist/production/route-data-fNWkI-4T.d.ts +0 -1749
package/README.md CHANGED
@@ -1,7 +1,16 @@
1
- `react-router` is the primary package in the React Router project.
1
+ # React Router
2
2
 
3
- ## Installation
3
+ The `react-router` package is the heart of [React Router](https://github.com/remix-run/react-router) and provides all
4
+ the core functionality for both
5
+ [`react-router-dom`](https://github.com/remix-run/react-router/tree/main/packages/react-router-dom)
6
+ and
7
+ [`react-router-native`](https://github.com/remix-run/react-router/tree/main/packages/react-router-native).
4
8
 
5
- ```sh
6
- npm i react-router
7
- ```
9
+ If you're using React Router, you should never `import` anything directly from
10
+ the `react-router` package, but you should have everything you need in either
11
+ `react-router-dom` or `react-router-native`. Both of those packages re-export
12
+ everything from `react-router`.
13
+
14
+ If you'd like to extend React Router and you know what you're doing, you should
15
+ add `react-router` **as a peer dependency, not a regular dependency** in your
16
+ package.
@@ -0,0 +1,30 @@
1
+ import type { ActionFunction, ActionFunctionArgs, AgnosticPatchRoutesOnNavigationFunction, AgnosticPatchRoutesOnNavigationFunctionArgs, Blocker, BlockerFunction, DataStrategyFunction, DataStrategyFunctionArgs, DataStrategyMatch, DataStrategyResult, ErrorResponse, Fetcher, HydrationState, InitialEntry, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, Navigation, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, RedirectFunction, RelativeRoutingType, Router as RemixRouter, FutureConfig as RouterFutureConfig, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch } from "@remix-run/router";
2
+ import { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, replace, resolvePath } from "@remix-run/router";
3
+ import type { AwaitProps, FutureConfig, IndexRouteProps, LayoutRouteProps, MemoryRouterProps, NavigateProps, OutletProps, PathRouteProps, RouteProps, RouterProps, RouterProviderProps, RoutesProps } from "./lib/components";
4
+ import { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, createRoutesFromChildren, renderMatches } from "./lib/components";
5
+ import type { DataRouteMatch, DataRouteObject, IndexRouteObject, NavigateOptions, Navigator, NonIndexRouteObject, RouteMatch, RouteObject } from "./lib/context";
6
+ import { DataRouterContext, DataRouterStateContext, LocationContext, NavigationContext, RouteContext } from "./lib/context";
7
+ import type { NavigateFunction } from "./lib/hooks";
8
+ import { useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteId, useRouteLoaderData, useRoutes, useRoutesImpl } from "./lib/hooks";
9
+ import { logV6DeprecationWarnings } from "./lib/deprecations";
10
+ type Hash = string;
11
+ type Pathname = string;
12
+ type Search = string;
13
+ export type { ActionFunction, ActionFunctionArgs, AwaitProps, DataRouteMatch, DataRouteObject, DataStrategyFunction, DataStrategyFunctionArgs, DataStrategyMatch, DataStrategyResult, ErrorResponse, Fetcher, FutureConfig, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LayoutRouteProps, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, Navigator, NonIndexRouteObject, OutletProps, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, PathRouteProps, Pathname, RedirectFunction, RelativeRoutingType, RouteMatch, RouteObject, RouteProps, RouterProps, RouterProviderProps, RoutesProps, Search, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, Blocker, BlockerFunction, };
14
+ export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes, createPath, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, replace, renderMatches, resolvePath, useBlocker, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, };
15
+ export type PatchRoutesOnNavigationFunctionArgs = AgnosticPatchRoutesOnNavigationFunctionArgs<RouteObject, RouteMatch>;
16
+ export type PatchRoutesOnNavigationFunction = AgnosticPatchRoutesOnNavigationFunction<RouteObject, RouteMatch>;
17
+ declare function mapRouteProperties(route: RouteObject): Partial<RouteObject> & {
18
+ hasErrorBoundary: boolean;
19
+ };
20
+ export declare function createMemoryRouter(routes: RouteObject[], opts?: {
21
+ basename?: string;
22
+ future?: Partial<Omit<RouterFutureConfig, "v7_prependBasename">>;
23
+ hydrationData?: HydrationState;
24
+ initialEntries?: InitialEntry[];
25
+ initialIndex?: number;
26
+ dataStrategy?: DataStrategyFunction;
27
+ patchRoutesOnNavigation?: PatchRoutesOnNavigationFunction;
28
+ }): RemixRouter;
29
+ /** @internal */
30
+ export { DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, logV6DeprecationWarnings as UNSAFE_logV6DeprecationWarnings, };