FAQ
Does it support pluralization?​
Not natively. Use Intl.PluralRules (a few lines) and key your strings by the form it returns. See the Intl formatters recipe.
Does it support ICU MessageFormat?​
No. Plain string templates with {{double-mustache}} tokens. For ICU, plug in @formatjs/intl-messageformat separately — pre-format and pass the resolved string as defaultMessage.
Does it support RTL or bidi-isolation wrappers?​
Not in the library. Set dir="rtl" on a wrapping element when the locale calls for it; if you need bidi isolation, render <bdi> yourself.
Does it auto-detect the user's locale?​
No. You pass the locale via the provider prop. We don't ship locale negotiation; if you need richer matching, Intl.Locale and @formatjs/intl-locale-matcher plug in cleanly.
Can I use it with React Native?​
In principle yes — there's no DOM dependency in the runtime. We don't currently test against RN in CI, so file an issue if you hit something odd.
Can I use it without a provider?​
Yes. useLocalize() returns a passthrough translate (returns the descriptor / defaultMessage). That makes the library safe to use in shared library components — they degrade gracefully when no provider is mounted.
Why module-scoped cache vs. provider-scoped?​
Behavioural parity with v1 (which shipped a module-scoped cache). See DECISIONS.md ADR-008 in the repo. In practice it makes no difference for single-provider apps and is slightly cheaper memory-wise.
Does it interact with React Server Components?​
LocalizationProvider is a client component (it uses useMemo + useEffect). Mount it once in a 'use client' boundary; everything below sees the context. Server components can compute strings out-of-band — see the Next.js recipe.
Why mustache {{name}} and not {name}?​
Disambiguates from JSX-like syntax. Easier to grep for. Matches Handlebars and dozens of other libraries' conventions.
Will you add ICU plurals/dates if I PR it?​
Probably not — it'd at least double the bundle and goes against the library's "smallest thing that works" goal. We'd happily review a separate sibling package (@localize-react/icu or similar) that composes on top.
Are types-only changes considered breaking?​
Yes — semver applies to the public type surface too. A stricter parameter type or a removed export is treated as major.
How do I report a security issue?​
Email the maintainer via the address on the yankouskia GitHub profile, or open a private security advisory on the repo. Please don't file public issues for vulnerabilities.
Where do releases land?​
npm (with provenance). Changelog on GitHub Releases — autogenerated via Changesets.