Skip to content

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

NameTypeRequiredDescription
resolveLocaleReactRouterLocaleResolver<TLocale>YesReadonly. Pick the locale for a request, for example from a cookie, path segment, or host.
i18nOptionsReactRouterI18nOptions | ((request: Request, locale: TLocale) => ReactRouterI18nOptions | Promise<ReactRouterI18nOptions>)NoReadonly. Formatting options for the request's i18n instance, or a function that returns them.
catalogDeliveryReactRouterCatalogDeliveryOptions | falseNoReadonly. Catalog delivery options, or false when the host injects the import map itself.
noncestring | ReactRouterNonceResolverNoReadonly. 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.
streamTimeoutnumberNoReadonly. 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.
failureMessagestringNoReadonly. Message of the error thrown when the request's catalog cannot be loaded.

Source entry on GitHub

Last updated: November 1, 2026