Using Hermes? Prefer native Intl & Temporal
We recommend the Rust-backed Hermes SDK (@formatjs/react-native-hermes-intl and @formatjs/react-native-hermes-temporal) over TypeScript polyfills for Hermes apps. It installs twelve Intl APIs and Temporal before your application JavaScript runs, with locale, calendar, and time-zone data compiled into the SDK.
Get started with native Intl & Temporal. Native integration requires rebuilding your app. Use TypeScript polyfills when you cannot add native code.
Browser#
Browser Support
We support IE11 & 2 most recent versions of Edge, Chrome, Firefox &
Safari. If you need older browser support, take a look at
polyfill-library that
also uses formatjs but pre-bundle other polyfills that we use.
React Intl relies on these Intl APIs:
-
Intl.NumberFormat: Available on IE11+
-
Intl.DateTimeFormat: Available on IE11+
-
Intl.PluralRules: This can be polyfilled using this package.
-
(Optional) Intl.RelativeTimeFormat: Required if you use
formatRelativeTimeorFormattedRelativeTime. This can be polyfilled using this package. -
(Optional) Intl.DisplayNames: Required if you use
formatDisplayNameorFormattedDisplayName. This can be polyfilled using this package. -
(Optional)
Intl.DurationFormat: Required forformatDuration,formatDurationToParts,FormattedDuration, andFormattedDurationParts. This can be polyfilled using@formatjs/intl-durationformat.
We officially support IE11 along with 2 most recent versions of Edge, Chrome & Firefox.
Node.js#
React Intl requires Node.js 16 or later, which includes full internationalization support by default. If your Node.js version is missing any of the Intl APIs above, you'd have to polyfill them accordingly.
React Native#
For Hermes apps, we recommend the native Hermes Intl SDK
(drop-in @formatjs/react-native-hermes-intl and optional
@formatjs/react-native-hermes-temporal packages for React Native 0.76+ with
New Architecture). Import them at the top of your entry point before
react-intl. Use the
TypeScript polyfill fallback if you cannot add
native code or rebuild your app.
For other React Native runtimes, make sure your runtime has built-in Intl support (similar to JSC International variant). See these issues for more details:
React Native on iOS without Hermes#
If you cannot use the Intl variant of JSC (e.g on iOS), follow the instructions in polyfills to polyfill the following APIs (in this order):