Package APIs

@i18n-micro/preact

Exported API of @i18n-micro/preact, generated from the source.

Preact bindings for i18n-micro — hooks, context, and UI components.

Entry points: @i18n-micro/preact, @i18n-micro/preact/router.

@i18n-micro/preact

Re-exports

Declared in another package of this repository and documented on its page.

@i18n-micro/preact/router

Also exports, as @i18n-micro/preact does: I18nRoutingStrategy.

Functions

createBrowserHistoryAdapter

Adapter over the History API, for any router built on it (wouter, preact-router...). Links render as <a>; I18nLink takes over plain clicks. A server has no address bar: pass the request's URL as ssrUrl, so links and the switcher render for that page. In a browser the address bar wins.

function createBrowserHistoryAdapter(
  locales: Locale[],
  defaultLocale: string,
  ssrUrl?: string,
): I18nRoutingStrategy

See Locale · I18nRoutingStrategy


Generated from the TypeScript sources and their JSDoc by pnpm run docs:generate. Back to all packages · Integration guides