React Router: CreateReactRouterI18nOptions
Functions, types, and exports for React Router: CreateReactRouterI18nOptions.
Page outline
import type { CreateReactRouterI18nOptions } from "@palamedes/react-router"
type CreateReactRouterI18nOptions<TLocale extends string = string> = {
/** Pick the locale for a request, for example from a cookie, path segment, or host. */
readonly resolveLocale: ReactRouterLocaleResolver<TLocale>;
/** Formatting options for the request's i18n instance, or a function that returns them. */
readonly i18nOptions?: ReactRouterI18nOptions | ((request: Request, locale: TLocale) => ReactRouterI18nOptions | Promise<ReactRouterI18nOptions>);
/** Catalog delivery options, or `false` when the host injects the import map itself. */
readonly catalogDelivery?: ReactRouterCatalogDeliveryOptions | false;
/**
* The CSP nonce for React's scripts, the import map, and the readiness
* script: a fixed string, or a resolver called at most once per document
* request. Its `context` is the request's load context, where a server may
* have stored the nonce.
*/
readonly nonce?: string | ReactRouterNonceResolver;
/**
* The server entry's stream timeout in milliseconds; defaults to 5000. The
* render is aborted one second after it, so rejected boundaries can still
* flush. Match the entry module's `streamTimeout` export if it has one.
*/
readonly streamTimeout?: number;
/** Message of the error thrown when the request's catalog cannot be loaded. */
readonly failureMessage?: string;
};
Properties
| Name | Type | Required | Description |
|---|---|---|---|
resolveLocale | ReactRouterLocaleResolver<TLocale> | Yes | Readonly. Pick the locale for a request, for example from a cookie, path segment, or host. |
i18nOptions | ReactRouterI18nOptions | ((request: Request, locale: TLocale) => ReactRouterI18nOptions | Promise<ReactRouterI18nOptions>) | No | Readonly. Formatting options for the request's i18n instance, or a function that returns them. |
catalogDelivery | ReactRouterCatalogDeliveryOptions | false | No | Readonly. Catalog delivery options, or false when the host injects the import map itself. |
nonce | string | ReactRouterNonceResolver | No | Readonly. The CSP nonce for React's scripts, the import map, and the readiness script: a fixed string, or a resolver called at most once per document request. Its context is the request's load context, where a server mayhave stored the nonce. |
streamTimeout | number | No | Readonly. The server entry's stream timeout in milliseconds; defaults to 5000. The render is aborted one second after it, so rejected boundaries can still flush. Match the entry module's streamTimeout export if it has one. |
failureMessage | string | No | Readonly. Message of the error thrown when the request's catalog cannot be loaded. |
Last updated: November 1, 2026