Replace AsyncStorage with instant synchronous reads and writes for user preferences and session tokens in a React Native app.
Store encrypted sensitive data like authentication tokens on iOS and Android using AES-128 or AES-256.
Share persistent storage between a React Native app and an iOS home screen widget using Apple App Groups.
Bind stored values to React component state so the UI automatically re-renders when data changes.
Uses Nitro Modules in v4, requires native module linking and an Expo config plugin if using Expo.
React Native MMKV is a storage library for React Native apps that lets you save and retrieve small pieces of data, like user preferences or session tokens, very quickly. It wraps MMKV, a key-value storage framework originally built by WeChat for their mobile apps, and makes it available to JavaScript code running in React Native. The library claims to be around 30 times faster than AsyncStorage, which is the storage solution built into React Native by default. The speed comes from how the library connects JavaScript to the native device code. Instead of going through the older React Native bridge, which passes messages back and forth asynchronously, this library uses a lower-level mechanism called JSI that allows JavaScript to call C++ functions directly and synchronously. That means when you read or write a value, the result is available immediately without waiting for a Promise or callback. You can store strings, numbers, booleans, and raw binary buffers. The library also supports optional encryption, so stored data can be protected with a key using AES-128 or AES-256. You can create multiple separate storage instances, which is useful for keeping different users' data isolated from one another, or for separating app-wide settings from per-user data. Storage can also be shared with iOS app extensions or widget targets through Apple's App Groups feature. For React developers, the library provides hooks that make storage values behave like regular state, so when a stored value changes, any component using it re-renders automatically. It works on iOS, Android, and Web. Installation follows standard React Native package steps, and there is a separate Expo integration. Version 4, the current release, uses a newer binding system called Nitro Modules. An upgrade guide is included in the docs for anyone migrating from version 3.
← mrousavy on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.