Ask your question and get a summary of the document by referencing this page and the AI provider of your choice
Version History
- "Re-export the full react-intlayer API (hooks, utilities, format/html/markdown subpaths) so a React Native app only depends on react-native-intlayer"v9.0.06/25/2026
- "Unified documentation for all exports"v8.0.01/21/2026
If you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentationCopy doc Markdown to clipboard
react-native-intlayer Package
The react-native-intlayer package provides the necessary tools to integrate Intlayer into React Native applications. It re-exports the full react-intlayer API (hooks and utilities) with a React Native-ready IntlayerProvider, plus the polyfills and Metro configuration required by React Native.
In a React Native app, import everything fromreact-native-intlayer. You do not need to install or importreact-intlayerdirectly.
Installation
Copy the code to the clipboard
npm install react-native-intlayerExports
Provider
Open the table in a modal to view all data content clearly
| Component | Description |
|---|---|
IntlayerProvider | Provider component that wraps your application and provides the Intlayer context. Automatically applies the required polyfills. |
Copy the code to the clipboard
import { IntlayerProvider } from "react-native-intlayer";Hooks and utilities
These are re-exported from react-intlayer, so you can import them straight from react-native-intlayer:
Open the table in a modal to view all data content clearly
| Export | Description |
|---|---|
useIntlayer | Access localized content for a dictionary key. |
useLocale | Read and change the current locale. |
useDictionary, useDictionaryAsync, useDictionaryDynamic, useLoadDynamic | Load dictionary content in various ways. |
useI18n | i18next-compatible hook. |
t | Inline translation helper. |
getIntlayer, getDictionary | Imperative content getters. |
localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage | Locale persistence helpers. |
Copy the code to the clipboard
import { useIntlayer, useLocale, t } from "react-native-intlayer";Polyfill
Open the table in a modal to view all data content clearly
| Function | Description |
|---|---|
intlayerPolyfill | Function that applies necessary polyfills for React Native to support Intlayer. |
Copy the code to the clipboard
import { intlayerPolyfill } from "react-native-intlayer";The polyfill is applied automatically when you importIntlayerProvider. CallintlayerPolyfillmanually only if you need the polyfills before the provider mounts.
Formatters
Number, date, and other Intl-based formatting hooks are available from the /format subpath:
Copy the code to the clipboard
import { useNumber, useDate } from "react-native-intlayer/format";Markdown and HTML rendering
Copy the code to the clipboard
import { MarkdownProvider } from "react-native-intlayer/markdown";import { HTMLProvider } from "react-native-intlayer/html";Metro Configuration
The react-native-intlayer package provides Metro configuration utilities to ensure that Intlayer works correctly with React Native.
Open the table in a modal to view all data content clearly
| Function | Description |
|---|---|
configMetroIntlayer | Asynchronous function that prepares Intlayer and merges the Metro configuration. |
configMetroIntlayerSync | Synchronous function that merges the Metro configuration without preparing Intlayer resources. |
exclusionList | Creates a RegExp pattern for Metro's blockList to exclude content files from the bundle. |
Copy the code to the clipboard
import { configMetroIntlayer } from "react-native-intlayer/metro";