Socket
Socket
Sign inDemoInstall

react-router

Package Overview
Dependencies
6
Maintainers
0
Versions
431
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.0-nightly-1974c2661-20240524 to 0.0.0-nightly-4996fbe2b-20240629

dist/lib/dom/ssr/entry.d.ts

14

CHANGELOG.md
# `react-router`
## 6.24.0
### Minor Changes
- Add support for Lazy Route Discovery (a.k.a. Fog of War) ([#11626](https://github.com/remix-run/react-router/pull/11626))
- RFC: <https://github.com/remix-run/react-router/discussions/11113>
- `unstable_patchRoutesOnMiss` docs: <https://reactrouter.com/en/main/routers/create-browser-router>
### Patch Changes
- Updated dependencies:
- `@remix-run/router@1.17.0`
## 6.23.1

@@ -4,0 +18,0 @@

54

dist/index.d.ts
import type { ActionFunction, ActionFunctionArgs, Blocker, BlockerFunction, unstable_DataStrategyFunction, unstable_DataStrategyFunctionArgs, unstable_DataStrategyMatch, ErrorResponse, Fetcher, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, Navigation, NavigationStates, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, RedirectFunction, RelativeRoutingType, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, unstable_HandlerResult } from "./lib/router";
import { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, resolvePath, UNSAFE_ErrorResponseImpl } from "./lib/router";
import type { AwaitProps, FutureConfig, IndexRouteProps, LayoutRouteProps, MemoryRouterProps, NavigateProps, OutletProps, PathRouteProps, RouteProps, RouterProps, RouterProviderProps, RoutesProps } from "./lib/components";
import { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, createRoutesFromChildren, renderMatches, createMemoryRouter, mapRouteProperties } from "./lib/components";
import type { AwaitProps, IndexRouteProps, LayoutRouteProps, MemoryRouterProps, NavigateProps, OutletProps, PathRouteProps, RouteProps, RouterProps, RoutesProps, unstable_PatchRoutesOnMissFunction } from "./lib/components";
import { Await, MemoryRouter, Navigate, Outlet, Route, Router, Routes, createRoutesFromChildren, renderMatches, createMemoryRouter, mapRouteProperties } from "./lib/components";
import type { DataRouteMatch, DataRouteObject, IndexRouteObject, NavigateOptions, Navigator, NonIndexRouteObject, RouteMatch, RouteObject } from "./lib/context";

@@ -12,9 +12,9 @@ import { DataRouterContext, DataRouterStateContext, LocationContext, NavigationContext, RouteContext } from "./lib/context";

type Search = string;
export type { ActionFunction, ActionFunctionArgs, AwaitProps, DataRouteMatch, DataRouteObject, unstable_DataStrategyFunction, unstable_DataStrategyFunctionArgs, unstable_DataStrategyMatch, ErrorResponse, Fetcher, FutureConfig, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LayoutRouteProps, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, NavigationStates, 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, unstable_HandlerResult, };
export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, resolvePath, useBlocker, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, };
export type { ActionFunction, ActionFunctionArgs, AwaitProps, DataRouteMatch, DataRouteObject, unstable_DataStrategyFunction, unstable_DataStrategyFunctionArgs, unstable_DataStrategyMatch, ErrorResponse, Fetcher, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LayoutRouteProps, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, NavigationStates, Navigator, NonIndexRouteObject, OutletProps, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, PathRouteProps, Pathname, RedirectFunction, RelativeRoutingType, RouteMatch, RouteObject, RouteProps, RouterProps, RoutesProps, Search, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, Blocker, BlockerFunction, unstable_HandlerResult, unstable_PatchRoutesOnMissFunction, };
export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, Routes, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, resolvePath, useBlocker, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, };
export type { AgnosticDataIndexRouteObject, AgnosticDataNonIndexRouteObject, AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, AgnosticRouteMatch, AgnosticRouteObject, HydrationState, InitialEntry, LowerCaseFormMethod, StaticHandler, TrackedPromise, FetcherStates, UpperCaseFormMethod, UNSAFE_DeferredData, } from "./lib/router";
export { getStaticContextFromError, stripBasename, UNSAFE_DEFERRED_SYMBOL, UNSAFE_convertRoutesToDataRoutes, } from "./lib/router";
export type { FormEncType, FormMethod, GetScrollRestorationKeyFunction, StaticHandlerContext, Submission, V7_FormMethod, } from "./lib/router";
export type { BrowserRouterProps, HashRouterProps, HistoryRouterProps, LinkProps, NavLinkProps, NavLinkRenderProps, FetcherFormProps, FormProps, ScrollRestorationProps, SetURLSearchParams, SubmitFunction, FetcherSubmitFunction, FetcherWithComponents, } from "./lib/dom/lib";
export { createBrowserRouter, createHashRouter, BrowserRouter, HashRouter, Link, UNSAFE_ViewTransitionContext, UNSAFE_FetchersContext, unstable_HistoryRouter, NavLink, Form, ScrollRestoration, useLinkClickHandler, useSearchParams, useSubmit, useFormAction, useFetcher, useFetchers, UNSAFE_useScrollRestoration, useBeforeUnload, unstable_usePrompt, unstable_useViewTransitionState, } from "./lib/dom/lib";
export type { FormEncType, FormMethod, GetScrollRestorationKeyFunction, StaticHandlerContext, Submission, } from "./lib/router";
export type { BrowserRouterProps, HashRouterProps, HistoryRouterProps, LinkProps, NavLinkProps, NavLinkRenderProps, FetcherFormProps, FormProps, ScrollRestorationProps, SetURLSearchParams, SubmitFunction, FetcherSubmitFunction, FetcherWithComponents, RouterProviderProps, } from "./lib/dom/lib";
export { createBrowserRouter, createHashRouter, BrowserRouter, HashRouter, Link, UNSAFE_ViewTransitionContext, UNSAFE_FetchersContext, unstable_HistoryRouter, NavLink, Form, RouterProvider, ScrollRestoration, useLinkClickHandler, useSearchParams, useSubmit, useFormAction, useFetcher, useFetchers, UNSAFE_useScrollRestoration, useBeforeUnload, unstable_usePrompt, unstable_useViewTransitionState, } from "./lib/dom/lib";
export type { ParamKeyValuePair, SubmitOptions, URLSearchParamsInit, SubmitTarget, } from "./lib/dom/dom";

@@ -27,16 +27,44 @@ export { createSearchParams } from "./lib/dom/dom";

export type { ScriptsProps } from "./lib/dom/ssr/components";
export type { EntryContext } from "./lib/dom/ssr/entry";
export type { HtmlLinkDescriptor, LinkDescriptor, PrefetchPageDescriptor, } from "./lib/dom/ssr/links";
export type { ClientActionFunction, ClientActionFunctionArgs, ClientLoaderFunction, ClientLoaderFunctionArgs, MetaArgs, MetaDescriptor, MetaFunction, LinksFunction, } from "./lib/dom/ssr/routeModules";
export type { RemixServerProps } from "./lib/dom/ssr/server";
export { RemixServer } from "./lib/dom/ssr/server";
export type { RemixStubProps } from "./lib/dom/ssr/create-remix-stub";
export { createRemixStub } from "./lib/dom/ssr/create-remix-stub";
export type { ServerRouterProps } from "./lib/dom/ssr/server";
export { ServerRouter } from "./lib/dom/ssr/server";
export type { RoutesTestStubProps } from "./lib/dom/ssr/routes-test-stub";
export { createRoutesStub } from "./lib/dom/ssr/routes-test-stub";
export { defineRoute, type Match, type MetaMatch, } from "./lib/router/define-route";
export { createCookieFactory, isCookie } from "./lib/server-runtime/cookies";
export { composeUploadHandlers as unstable_composeUploadHandlers, parseMultipartFormData as unstable_parseMultipartFormData, } from "./lib/server-runtime/formData";
export { createRequestHandler } from "./lib/server-runtime/server";
export { createSession, createSessionStorageFactory, isSession, } from "./lib/server-runtime/sessions";
export { createCookieSessionStorageFactory } from "./lib/server-runtime/sessions/cookieStorage";
export { createMemorySessionStorageFactory } from "./lib/server-runtime/sessions/memoryStorage";
export { createMemoryUploadHandler as unstable_createMemoryUploadHandler } from "./lib/server-runtime/upload/memoryUploadHandler";
export { MaxPartSizeExceededError } from "./lib/server-runtime/upload/errors";
export { setDevServerHooks as unstable_setDevServerHooks } from "./lib/server-runtime/dev";
export type { CreateCookieFunction, IsCookieFunction, } from "./lib/server-runtime/cookies";
export type { CreateRequestHandlerFunction } from "./lib/server-runtime/server";
export type { CreateSessionFunction, CreateSessionStorageFunction, IsSessionFunction, } from "./lib/server-runtime/sessions";
export type { CreateCookieSessionStorageFunction } from "./lib/server-runtime/sessions/cookieStorage";
export type { CreateMemorySessionStorageFunction } from "./lib/server-runtime/sessions/memoryStorage";
export type { HandleDataRequestFunction, HandleDocumentRequestFunction, HandleErrorFunction, ServerBuild, ServerEntryModule, } from "./lib/server-runtime/build";
export type { UploadHandlerPart, UploadHandler, } from "./lib/server-runtime/formData";
export type { MemoryUploadHandlerOptions, MemoryUploadHandlerFilterArgs, } from "./lib/server-runtime/upload/memoryUploadHandler";
export type { Cookie, CookieOptions, CookieParseOptions, CookieSerializeOptions, CookieSignatureOptions, } from "./lib/server-runtime/cookies";
export type { SignFunction, UnsignFunction } from "./lib/server-runtime/crypto";
export type { AppLoadContext } from "./lib/server-runtime/data";
export type { PageLinkDescriptor, } from "./lib/server-runtime/links";
export type { TypedDeferredData, TypedResponse, } from "./lib/server-runtime/responses";
export type { DataFunctionArgs, HeadersArgs, HeadersFunction, } from "./lib/server-runtime/routeModules";
export type { RequestHandler } from "./lib/server-runtime/server";
export type { Session, SessionData, SessionIdStorageStrategy, SessionStorage, FlashSessionData, } from "./lib/server-runtime/sessions";
export { ServerMode as UNSAFE_ServerMode } from "./lib/server-runtime/mode";
/** @internal */
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, UNSAFE_ErrorResponseImpl, };
/** @internal */
export { RemixContext as UNSAFE_RemixContext } from "./lib/dom/ssr/components";
export { FrameworkContext as UNSAFE_FrameworkContext } from "./lib/dom/ssr/components";
/** @internal */
export type { RouteModules as UNSAFE_RouteModules } from "./lib/dom/ssr/routeModules";
/** @internal */
export type { FutureConfig as UNSAFE_FutureConfig, AssetsManifest as UNSAFE_AssetsManifest, RemixContextObject as UNSAFE_RemixContextObject, } from "./lib/dom/ssr/entry";
export type { FutureConfig as UNSAFE_FutureConfig, AssetsManifest as UNSAFE_AssetsManifest, FrameworkContextObject as UNSAFE_FrameworkContextObject, } from "./lib/dom/ssr/entry";
/** @internal */

@@ -43,0 +71,0 @@ export type { EntryRoute as UNSAFE_EntryRoute, RouteManifest as UNSAFE_RouteManifest, } from "./lib/dom/ssr/routes";

@@ -1,9 +0,5 @@

import type { FutureConfig as RouterFutureConfig, HydrationState, InitialEntry, LazyRouteFunction, Location, RelativeRoutingType, Router as RemixRouter, To, TrackedPromise, unstable_DataStrategyFunction } from "./router";
import type { FutureConfig, HydrationState, InitialEntry, LazyRouteFunction, Location, RelativeRoutingType, Router as RemixRouter, To, TrackedPromise, unstable_DataStrategyFunction, unstable_AgnosticPatchRoutesOnMissFunction } from "./router";
import { Action as NavigationType } from "./router";
import * as React from "react";
import type { IndexRouteObject, Navigator, NonIndexRouteObject, RouteMatch, RouteObject } from "./context";
export interface FutureConfig {
v7_relativeSplatPath: boolean;
v7_startTransition: boolean;
}
/**

@@ -15,2 +11,4 @@ * @private

};
export interface unstable_PatchRoutesOnMissFunction extends unstable_AgnosticPatchRoutesOnMissFunction<RouteMatch> {
}
/**

@@ -21,3 +19,3 @@ * @category Routers

basename?: string;
future?: Partial<Omit<RouterFutureConfig, "v7_prependBasename">>;
future?: Partial<FutureConfig>;
hydrationData?: HydrationState;

@@ -27,2 +25,3 @@ initialEntries?: InitialEntry[];

unstable_dataStrategy?: unstable_DataStrategyFunction;
unstable_patchRoutesOnMiss?: unstable_PatchRoutesOnMissFunction;
}): RemixRouter;

@@ -32,16 +31,2 @@ /**

*/
export interface RouterProviderProps {
fallbackElement?: React.ReactNode;
router: RemixRouter;
future?: Partial<Pick<FutureConfig, "v7_startTransition">>;
}
/**
* Given a Remix Router instance, render the appropriate UI
*
* @category Router Components
*/
export declare function RouterProvider({ fallbackElement, router, future, }: RouterProviderProps): React.ReactElement;
/**
* @category Types
*/
export interface MemoryRouterProps {

@@ -52,3 +37,2 @@ basename?: string;

initialIndex?: number;
future?: Partial<FutureConfig>;
}

@@ -60,3 +44,3 @@ /**

*/
export declare function MemoryRouter({ basename, children, initialEntries, initialIndex, future, }: MemoryRouterProps): React.ReactElement;
export declare function MemoryRouter({ basename, children, initialEntries, initialIndex, }: MemoryRouterProps): React.ReactElement;
/**

@@ -111,3 +95,3 @@ * @category Types

```
@category Components

@@ -185,3 +169,2 @@ */

static?: boolean;
future?: Partial<Pick<FutureConfig, "v7_relativeSplatPath">>;
}

@@ -197,3 +180,3 @@ /**

*/
export declare function Router({ basename: basenameProp, children, location: locationProp, navigationType, navigator, static: staticProp, future, }: RouterProps): React.ReactElement | null;
export declare function Router({ basename: basenameProp, children, location: locationProp, navigationType, navigator, static: staticProp, }: RouterProps): React.ReactElement | null;
/**

@@ -200,0 +183,0 @@ * @category Types

@@ -85,5 +85,3 @@ import * as React from "react";

static: boolean;
future: {
v7_relativeSplatPath: boolean;
};
future: {};
}

@@ -90,0 +88,0 @@ export declare const NavigationContext: React.Context<NavigationContextObject>;

@@ -18,5 +18,5 @@ import type { FormEncType, HTMLFormMethod, RelativeRoutingType } from "../router";

values for a given key, but don't want to use an array initializer.
For example, instead of:
```tsx

@@ -49,3 +49,6 @@ let searchParams = new URLSearchParams([

export type SubmitTarget = HTMLFormElement | HTMLButtonElement | HTMLInputElement | FormData | URLSearchParams | JsonValue | null;
export interface SubmitOptions {
/**
* Submit options shared by both navigations and fetchers
*/
interface SharedSubmitOptions {
/**

@@ -67,10 +70,27 @@ * The HTTP method used to submit the form. Overrides `<form method>`.

/**
* Indicate a specific fetcherKey to use when using navigate=false
* Determines whether the form action is relative to the route hierarchy or
* the pathname. Use this if you want to opt out of navigating the route
* hierarchy and want to instead route based on /-delimited URL segments
*/
fetcherKey?: string;
relative?: RelativeRoutingType;
/**
* navigate=false will use a fetcher instead of a navigation
* In browser-based environments, prevent resetting scroll after this
* navigation when using the <ScrollRestoration> component
*/
navigate?: boolean;
preventScrollReset?: boolean;
/**
* Enable flushSync for this submission's state updates
*/
unstable_flushSync?: boolean;
}
/**
* Submit options available to fetchers
*/
export interface FetcherSubmitOptions extends SharedSubmitOptions {
}
/**
* Submit options available to navigations
*/
export interface SubmitOptions extends FetcherSubmitOptions {
/**
* Set `true` to replace the current entry in the browser's history stack

@@ -86,17 +106,10 @@ * instead of creating a new one (i.e. stay on "the same page"). Defaults

/**
* Determines whether the form action is relative to the route hierarchy or
* the pathname. Use this if you want to opt out of navigating the route
* hierarchy and want to instead route based on /-delimited URL segments
* Indicate a specific fetcherKey to use when using navigate=false
*/
relative?: RelativeRoutingType;
fetcherKey?: string;
/**
* In browser-based environments, prevent resetting scroll after this
* navigation when using the <ScrollRestoration> component
* navigate=false will use a fetcher instead of a navigation
*/
preventScrollReset?: boolean;
navigate?: boolean;
/**
* Enable flushSync for this navigation's state updates
*/
unstable_flushSync?: boolean;
/**
* Enable view transitions on this submission navigation

@@ -103,0 +116,0 @@ */

import * as React from "react";
import type { unstable_DataStrategyFunction, Fetcher, FutureConfig as RouterFutureConfig, GetScrollRestorationKeyFunction, History, HTMLFormMethod, HydrationState, Router as RemixRouter, BlockerFunction, Location, RelativeRoutingType, To } from "../router";
import type { unstable_DataStrategyFunction, Fetcher, FutureConfig, GetScrollRestorationKeyFunction, History, HTMLFormMethod, HydrationState, Router as RemixRouter, BlockerFunction, Location, RelativeRoutingType, To } from "../router";
import "./global";
import type { SubmitOptions, URLSearchParamsInit, SubmitTarget } from "./dom";
import type { PrefetchBehavior, ScriptsProps } from "./ssr/components";
import type { RouterProviderProps, FutureConfig as RenderFutureConfig } from "../components";
import type { SubmitOptions, URLSearchParamsInit, SubmitTarget, FetcherSubmitOptions } from "./dom";
import type { DiscoverBehavior, PrefetchBehavior, ScriptsProps } from "./ssr/components";
import type { unstable_PatchRoutesOnMissFunction } from "../components";
import type { RouteObject, NavigateOptions } from "../context";
interface DOMRouterOpts {
basename?: string;
future?: Partial<Omit<RouterFutureConfig, "v7_prependBasename">>;
future?: Partial<FutureConfig>;
hydrationData?: HydrationState;
unstable_dataStrategy?: unstable_DataStrategyFunction;
unstable_patchRoutesOnMiss?: unstable_PatchRoutesOnMissFunction;
window?: Window;

@@ -42,6 +43,9 @@ }

}
export interface RouterProviderProps {
router: RemixRouter;
}
/**
* Given a Remix Router instance, render the appropriate UI
*/
export declare function RouterProvider({ fallbackElement, router, future, }: RouterProviderProps): React.ReactElement;
export declare function RouterProvider({ router, }: RouterProviderProps): React.ReactElement;
/**

@@ -53,3 +57,2 @@ * @category Types

children?: React.ReactNode;
future?: Partial<RenderFutureConfig>;
window?: Window;

@@ -62,3 +65,3 @@ }

*/
export declare function BrowserRouter({ basename, children, future, window, }: BrowserRouterProps): React.JSX.Element;
export declare function BrowserRouter({ basename, children, window, }: BrowserRouterProps): React.JSX.Element;
/**

@@ -70,3 +73,2 @@ * @category Types

children?: React.ReactNode;
future?: Partial<RenderFutureConfig>;
window?: Window;

@@ -80,3 +82,3 @@ }

*/
export declare function HashRouter({ basename, children, future, window, }: HashRouterProps): React.JSX.Element;
export declare function HashRouter({ basename, children, window }: HashRouterProps): React.JSX.Element;
/**

@@ -88,3 +90,2 @@ * @category Types

children?: React.ReactNode;
future?: RenderFutureConfig;
history: History;

@@ -100,3 +101,3 @@ }

*/
declare function HistoryRouter({ basename, children, future, history, }: HistoryRouterProps): React.JSX.Element;
declare function HistoryRouter({ basename, children, history }: HistoryRouterProps): React.JSX.Element;
declare namespace HistoryRouter {

@@ -111,2 +112,15 @@ var displayName: string;

/**
Defines the link discovery behavior
```tsx
<Link /> // default ("render")
<Link discover="render" />
<Link discover="none" />
```
- **render** - default, discover the route when the link renders
- **none** - don't eagerly discover, only discover if the link is clicked
*/
discover?: DiscoverBehavior;
/**
Defines the data and module prefetching behavior for the link.

@@ -358,3 +372,3 @@

Wraps {@link Link | `<Link>`} with additional props for styling active and pending states.
- Automatically applies classes to the link based on its active and pending states, see {@link NavLinkProps.className}.

@@ -384,3 +398,6 @@ - Automatically applies `aria-current="page"` to the link when the link is active. See [`aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current) on MDN.

export declare const NavLink: React.ForwardRefExoticComponent<NavLinkProps & React.RefAttributes<HTMLAnchorElement>>;
export interface FetcherFormProps extends React.FormHTMLAttributes<HTMLFormElement> {
/**
* Form props shared by navigations and fetchers
*/
interface SharedFormProps extends React.FormHTMLAttributes<HTMLFormElement> {
/**

@@ -420,5 +437,13 @@ * The HTTP verb to use when the form is submitted. Supports "get", "post",

/**
* Form props available to fetchers
* @category Types
*/
export interface FormProps extends FetcherFormProps {
export interface FetcherFormProps extends SharedFormProps {
}
/**
* Form props available to navigations
* @category Types
*/
export interface FormProps extends SharedFormProps {
discover?: DiscoverBehavior;
/**

@@ -679,3 +704,3 @@ * Indicates a specific fetcherKey to use when using `navigate={false}` so you

*/
target: SubmitTarget, options?: Omit<SubmitOptions, "replace" | "state">): Promise<void>;
target: SubmitTarget, options?: FetcherSubmitOptions): Promise<void>;
}

@@ -798,3 +823,3 @@ /**

Loads data from a route. Useful for loading data imperatively inside of user events outside of a normal button or form, like a combobox or search input.
```tsx

@@ -820,3 +845,3 @@ let fetcher = useFetcher()

Useful for creating complex, dynamic user interfaces that require multiple, concurrent data interactions without causing a navigation.
Fetchers track their own, independent state and can be used to load data, submit forms, and generally interact with loaders and actions.

@@ -823,0 +848,0 @@

import * as React from "react";
import type { Location, Router as RemixRouter, StaticHandlerContext, CreateStaticHandlerOptions as RouterCreateStaticHandlerOptions, FutureConfig as RouterFutureConfig } from "../router";
import { type FutureConfig } from "../components";
import type { Location, Router as RemixRouter, StaticHandlerContext, CreateStaticHandlerOptions as RouterCreateStaticHandlerOptions, FutureConfig } from "../router";
import type { RouteObject } from "../context";

@@ -9,3 +8,2 @@ export interface StaticRouterProps {

location: Partial<Location> | string;
future?: Partial<FutureConfig>;
}

@@ -18,3 +16,3 @@ /**

*/
export declare function StaticRouter({ basename, children, location: locationProp, future, }: StaticRouterProps): React.JSX.Element;
export declare function StaticRouter({ basename, children, location: locationProp, }: StaticRouterProps): React.JSX.Element;
export interface StaticRouterProviderProps {

@@ -42,4 +40,4 @@ context: StaticHandlerContext;

export declare function createStaticRouter(routes: RouteObject[], context: StaticHandlerContext, opts?: {
future?: Partial<Pick<RouterFutureConfig, "v7_partialHydration" | "v7_relativeSplatPath">>;
future?: Partial<FutureConfig>;
}): RemixRouter;
export {};
import type { FocusEventHandler, MouseEventHandler, TouchEventHandler } from "react";
import * as React from "react";
import type { RemixContextObject } from "./entry";
import type { FrameworkContextObject } from "./entry";
import type { PrefetchPageDescriptor } from "./links";
export type SerializeFrom<D> = D extends () => {} ? Awaited<ReturnType<D>> : D;
export declare const RemixContext: React.Context<RemixContextObject | undefined>;
export declare function useRemixContext(): RemixContextObject;
export declare const FrameworkContext: React.Context<FrameworkContextObject | undefined>;
export declare function useFrameworkContext(): FrameworkContextObject;
/**
* Defines the discovery behavior of the link:
*
* - "render" - default, discover the route when the link renders
* - "none" - don't eagerly discover, only discover if the link is clicked
*/
export type DiscoverBehavior = "render" | "none";
/**
* Defines the prefetching behavior of the link:

@@ -10,0 +17,0 @@ *

@@ -5,2 +5,3 @@ import * as React from "react";

location: Location;
isOutsideRemixApp?: boolean;
error?: Error;

@@ -26,10 +27,12 @@ }>;

*/
export declare function RemixRootDefaultErrorBoundary({ error }: {
export declare function RemixRootDefaultErrorBoundary({ error, isOutsideRemixApp, }: {
error: unknown;
isOutsideRemixApp?: boolean;
}): React.JSX.Element;
export declare function BoundaryShell({ title, renderScripts, children, }: {
export declare function BoundaryShell({ title, renderScripts, isOutsideRemixApp, children, }: {
title: string;
renderScripts?: boolean;
isOutsideRemixApp?: boolean;
children: React.ReactNode | React.ReactNode[];
}): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
export {};

@@ -30,4 +30,4 @@ import type { HydrationState } from "../../router";

export declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, future: FutureConfig, isSpaMode: boolean): DataRouteObject[];
export declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, future: FutureConfig, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
export declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
export declare function shouldHydrateRouteLoader(route: EntryRoute, routeModule: RouteModule, isSpaMode: boolean): boolean;
export {};
import type { ReactElement } from "react";
import type { EntryContext } from "./entry";
export interface RemixServerProps {
export interface ServerRouterProps {
context: EntryContext;

@@ -16,2 +16,2 @@ url: string | URL;

*/
export declare function RemixServer({ context, url, abortDelay, nonce, }: RemixServerProps): ReactElement;
export declare function ServerRouter({ context, url, abortDelay, nonce, }: ServerRouterProps): ReactElement;

@@ -232,3 +232,3 @@ import * as React from "react";

```
@category Hooks

@@ -373,3 +373,3 @@ */

```
@category Hooks

@@ -383,3 +383,3 @@ */

import { Await, useAsyncError } from "react-router"
function ErrorElement() {

@@ -386,0 +386,0 @@ const error = useAsyncError();

@@ -1,2 +0,2 @@

export type { ActionFunction, ActionFunctionArgs, AgnosticDataIndexRouteObject, AgnosticDataNonIndexRouteObject, AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, AgnosticRouteMatch, AgnosticRouteObject, DataStrategyFunction as unstable_DataStrategyFunction, DataStrategyFunctionArgs as unstable_DataStrategyFunctionArgs, DataStrategyMatch as unstable_DataStrategyMatch, ErrorResponse, FormEncType, FormMethod, HandlerResult as unstable_HandlerResult, HTMLFormMethod, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, LowerCaseFormMethod, ParamParseKey, Params, PathMatch, PathParam, PathPattern, RedirectFunction, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, Submission, TrackedPromise, UIMatch, UpperCaseFormMethod, V7_FormMethod, } from "./utils";
export type { ActionFunction, ActionFunctionArgs, AgnosticDataIndexRouteObject, AgnosticDataNonIndexRouteObject, AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, AgnosticRouteMatch, AgnosticRouteObject, DataStrategyFunction as unstable_DataStrategyFunction, DataStrategyFunctionArgs as unstable_DataStrategyFunctionArgs, DataStrategyMatch as unstable_DataStrategyMatch, ErrorResponse, FormEncType, FormMethod, HandlerResult as unstable_HandlerResult, HTMLFormMethod, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, LowerCaseFormMethod, ParamParseKey, Params, AgnosticPatchRoutesOnMissFunction as unstable_AgnosticPatchRoutesOnMissFunction, PathMatch, PathParam, PathPattern, RedirectFunction, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, Submission, TrackedPromise, UIMatch, UpperCaseFormMethod, } from "./utils";
export { AbortedDeferredError, defer, generatePath, getToPathname, isRouteErrorResponse, joinPaths, json, matchPath, matchRoutes, normalizePathname, redirect, redirectDocument, resolvePath, resolveTo, stripBasename, } from "./utils";

@@ -8,3 +8,3 @@ export type { BrowserHistory, BrowserHistoryOptions, HashHistory, HashHistoryOptions, History, InitialEntry, Location, MemoryHistory, MemoryHistoryOptions, Path, To, } from "./history";

export type { RouteManifest as UNSAFE_RouteManifest } from "./utils";
export { DeferredData as UNSAFE_DeferredData, ErrorResponseImpl as UNSAFE_ErrorResponseImpl, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, convertRouteMatchToUiMatch as UNSAFE_convertRouteMatchToUiMatch, getResolveToMatches as UNSAFE_getResolveToMatches, } from "./utils";
export { DeferredData as UNSAFE_DeferredData, ErrorResponseImpl as UNSAFE_ErrorResponseImpl, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, convertRouteMatchToUiMatch as UNSAFE_convertRouteMatchToUiMatch, } from "./utils";
export { invariant as UNSAFE_invariant, warning as UNSAFE_warning, } from "./history";
import type { History, Location, Path, To } from "./history";
import { Action as HistoryAction } from "./history";
import type { AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticRouteObject, DataStrategyFunction, DeferredData, DetectErrorBoundaryFunction, FormEncType, HTMLFormMethod, MapRoutePropertiesFunction, RouteData, Submission, UIMatch } from "./utils";
import type { AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticRouteObject, DataStrategyFunction, DeferredData, DetectErrorBoundaryFunction, FormEncType, HTMLFormMethod, MapRoutePropertiesFunction, RouteData, Submission, UIMatch, AgnosticPatchRoutesOnMissFunction } from "./utils";
/**

@@ -165,2 +165,12 @@ * A Router instance manages all navigation and data loading/mutations

* @private
* PRIVATE DO NOT USE
*
* Patch additional children routes into an existing parent route
* @param routeId The parent route id or a callback function accepting `patch`
* to perform batch patching
* @param children The additional children routes
*/
patchRoutes(routeId: string | null, children: AgnosticRouteObject[]): void;
/**
* @private
* PRIVATE - DO NOT USE

@@ -257,7 +267,2 @@ *

export interface FutureConfig {
v7_fetcherPersist: boolean;
v7_normalizeFormMethod: boolean;
v7_partialHydration: boolean;
v7_prependBasename: boolean;
v7_relativeSplatPath: boolean;
unstable_skipActionErrorRevalidation: boolean;

@@ -280,2 +285,3 @@ }

window?: Window;
unstable_patchRoutesOnMiss?: AgnosticPatchRoutesOnMissFunction;
unstable_dataStrategy?: DataStrategyFunction;

@@ -537,9 +543,2 @@ }

export declare const UNSAFE_DEFERRED_SYMBOL: unique symbol;
/**
* Future flags to toggle new feature behavior
*/
export interface StaticHandlerFutureConfig {
v7_relativeSplatPath: boolean;
v7_throwAbortReason: boolean;
}
export interface CreateStaticHandlerOptions {

@@ -552,3 +551,3 @@ basename?: string;

mapRouteProperties?: MapRoutePropertiesFunction;
future?: Partial<StaticHandlerFutureConfig>;
future?: {};
}

@@ -555,0 +554,0 @@ export declare function createStaticHandler(routes: AgnosticRouteObject[], opts?: CreateStaticHandlerOptions): StaticHandler;

@@ -68,13 +68,7 @@ import type { Location, Path, To } from "./history";

/**
* Active navigation/fetcher form methods are exposed in lowercase on the
* RouterState
* Active navigation/fetcher form methods are exposed in uppercase on the
* RouterState. This is to align with the normalization done via fetch().
*/
export type FormMethod = LowerCaseFormMethod;
export type MutationFormMethod = Exclude<FormMethod, "get">;
/**
* In v7, active navigation/fetcher form methods are exposed in uppercase on the
* RouterState. This is to align with the normalization done via fetch().
*/
export type V7_FormMethod = UpperCaseFormMethod;
export type V7_MutationFormMethod = Exclude<V7_FormMethod, "GET">;
export type FormMethod = UpperCaseFormMethod;
export type MutationFormMethod = Exclude<FormMethod, "GET">;
export type FormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "application/json" | "text/plain";

@@ -95,3 +89,3 @@ type JsonObject = {

export type Submission = {
formMethod: FormMethod | V7_FormMethod;
formMethod: FormMethod;
formAction: string;

@@ -103,3 +97,3 @@ formEncType: FormEncType;

} | {
formMethod: FormMethod | V7_FormMethod;
formMethod: FormMethod;
formAction: string;

@@ -111,3 +105,3 @@ formEncType: FormEncType;

} | {
formMethod: FormMethod | V7_FormMethod;
formMethod: FormMethod;
formAction: string;

@@ -207,2 +201,9 @@ formEncType: FormEncType;

}
export interface AgnosticPatchRoutesOnMissFunction<M extends AgnosticRouteMatch = AgnosticRouteMatch> {
(opts: {
path: string;
matches: M[];
patch: (routeId: string | null, children: AgnosticRouteObject[]) => void;
}): void | Promise<void>;
}
/**

@@ -322,3 +323,3 @@ * Function provided by the framework-aware layers to set any framework-specific

}
export declare function convertRoutesToDataRoutes(routes: AgnosticRouteObject[], mapRouteProperties: MapRoutePropertiesFunction, parentPath?: number[], manifest?: RouteManifest): AgnosticDataRouteObject[];
export declare function convertRoutesToDataRoutes(routes: AgnosticRouteObject[], mapRouteProperties: MapRoutePropertiesFunction, parentPath?: string[], manifest?: RouteManifest): AgnosticDataRouteObject[];
/**

@@ -330,2 +331,3 @@ * Matches the given routes to a location and returns the match data.

export declare function matchRoutes<RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject>(routes: RouteObjectType[], locationArg: Partial<Location> | string, basename?: string): AgnosticRouteMatch<string, RouteObjectType>[] | null;
export declare function matchRoutesImpl<RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject>(routes: RouteObjectType[], locationArg: Partial<Location> | string, basename: string, allowPartial: boolean): AgnosticRouteMatch<string, RouteObjectType>[] | null;
export interface UIMatch<Data = unknown, Handle = unknown> {

@@ -429,3 +431,3 @@ id: string;

export declare function getPathContributingMatches<T extends AgnosticRouteMatch = AgnosticRouteMatch>(matches: T[]): T[];
export declare function getResolveToMatches<T extends AgnosticRouteMatch = AgnosticRouteMatch>(matches: T[], v7_relativeSplatPath: boolean): string[];
export declare function getResolveToMatches<T extends AgnosticRouteMatch = AgnosticRouteMatch>(matches: T[]): string[];
/**

@@ -432,0 +434,0 @@ * @private

/**
* React Router v0.0.0-nightly-1974c2661-20240524
* React Router v0.0.0-nightly-4996fbe2b-20240629
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

{
"name": "react-router",
"version": "0.0.0-nightly-1974c2661-20240524",
"version": "0.0.0-nightly-4996fbe2b-20240629",
"description": "Declarative routing for React",

@@ -26,3 +26,8 @@ "keywords": [

"dependencies": {
"turbo-stream": "^2.0.0"
"@types/cookie": "^0.6.0",
"@web3-storage/multipart-parser": "^1.0.0",
"cookie": "^0.6.0",
"source-map": "^0.7.3",
"turbo-stream": "^2.2.0",
"react-router": "0.0.0-nightly-4996fbe2b-20240629"
},

@@ -34,4 +39,4 @@ "devDependencies": {

"peerDependencies": {
"react": ">=16.8",
"react-dom": ">=16.8"
"react": ">=18",
"react-dom": ">=18"
},

@@ -50,4 +55,4 @@ "peerDependenciesMeta": {

"engines": {
"node": ">=14.0.0"
"node": ">=18.0.0"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc