Registry /
storage / i18next-react-native-async-storage
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default (AsyncStoragePlugin)
✓ import AsyncStoragePlugin from 'i18next-react-native-async-storage'
✗ const AsyncStoragePlugin = require('i18next-react-native-async-storage')
Package is ESM-only; CommonJS require may fail in some bundlers. Default export is a function.
AsyncStoragePlugin() usage
✓ i18n.use(AsyncStoragePlugin())
✗ i18n.use(AsyncStoragePlugin)
AsyncStoragePlugin is a factory function that must be called (with optional fallback) before passing to .use().
Fallback function parameter
✓ i18n.use(AsyncStoragePlugin(() => 'en'))
✗ i18n.use(AsyncStoragePlugin('en'))
When passing a fallback function, it must be a function that takes a callback, not a string. String fallback is also valid, but the function signature is different.
Initializes i18next with React Native Async Storage caching, using react-i18next bridge.
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import AsyncStoragePlugin from 'i18next-react-native-async-storage';
const resources = {
en: { translation: { key: 'hello' } },
es: { translation: { key: 'hola' } },
};
i18n
.use(AsyncStoragePlugin())
.use(initReactI18next)
.init({
resources,
fallbackLng: 'en',
interpolation: { escapeValue: false },
});
export default i18n;
Errors
Common errors & fixes
TypeError: _async_storage.default.getItem is not a function
AsyncStorage default export is not a function in newer versions of @react-native-async-storage/async-storage.
fixEnsure @react-native-async-storage/async-storage is installed and properly linked. If using Expo, use expo-secure-store or a custom solution.
Module not found: Can't resolve 'i18next-react-native-async-storage'
Package not installed or spelled incorrectly.
fixRun: npm install i18next-react-native-async-storage
Cannot use import statement outside a module
Package uses ESM, and your project may be configured as CommonJS.
fixSet "type": "module" in package.json or use dynamic import.
Audit
Dependencies
i18nextrequiredpeer dependency, required for plugin to integrate with i18next instance
@react-native-async-storage/async-storagerequiredrequired at runtime to store/retrieve language, must be installed separately