UNPKG

1.66 kBTypeScriptView Raw
1import * as React from "react";
2import type { Router as RemixRouter, StaticHandlerContext, CreateStaticHandlerOptions as RouterCreateStaticHandlerOptions, FutureConfig as RouterFutureConfig } from "@remix-run/router";
3import type { FutureConfig, Location, RouteObject } from "react-router-dom";
4export interface StaticRouterProps {
5 basename?: string;
6 children?: React.ReactNode;
7 location: Partial<Location> | string;
8 future?: Partial<FutureConfig>;
9}
10/**
11 * A `<Router>` that may not navigate to any other location. This is useful
12 * on the server where there is no stateful UI.
13 */
14export declare function StaticRouter({ basename, children, location: locationProp, future, }: StaticRouterProps): React.JSX.Element;
15export { StaticHandlerContext };
16export interface StaticRouterProviderProps {
17 context: StaticHandlerContext;
18 router: RemixRouter;
19 hydrate?: boolean;
20 nonce?: string;
21}
22/**
23 * A Data Router that may not navigate to any other location. This is useful
24 * on the server where there is no stateful UI.
25 */
26export declare function StaticRouterProvider({ context, router, hydrate, nonce, }: StaticRouterProviderProps): React.JSX.Element;
27type CreateStaticHandlerOptions = Omit<RouterCreateStaticHandlerOptions, "detectErrorBoundary" | "mapRouteProperties">;
28export declare function createStaticHandler(routes: RouteObject[], opts?: CreateStaticHandlerOptions): import("@remix-run/router").StaticHandler;
29export declare function createStaticRouter(routes: RouteObject[], context: StaticHandlerContext, opts?: {
30 future?: Partial<Pick<RouterFutureConfig, "v7_partialHydration" | "v7_relativeSplatPath">>;
31}): RemixRouter;