server.d.ts 1.1 KB

12345678910111213141516171819202122232425
  1. import * as React from "react";
  2. import type { Router as RemixRouter, StaticHandlerContext } from "@remix-run/router";
  3. import type { Location, RouteObject } from "react-router-dom";
  4. export interface StaticRouterProps {
  5. basename?: string;
  6. children?: React.ReactNode;
  7. location: Partial<Location> | string;
  8. }
  9. /**
  10. * A <Router> that may not navigate to any other location. This is useful
  11. * on the server where there is no stateful UI.
  12. */
  13. export declare function StaticRouter({ basename, children, location: locationProp, }: StaticRouterProps): JSX.Element;
  14. export interface StaticRouterProviderProps {
  15. context: StaticHandlerContext;
  16. router: RemixRouter;
  17. hydrate?: boolean;
  18. nonce?: string;
  19. }
  20. /**
  21. * A Data Router that may not navigate to any other location. This is useful
  22. * on the server where there is no stateful UI.
  23. */
  24. export declare function StaticRouterProvider({ context, router, hydrate, nonce, }: StaticRouterProviderProps): JSX.Element;
  25. export declare function createStaticRouter(routes: RouteObject[], context: StaticHandlerContext): RemixRouter;