react-native-mmkv

Implements synchronous key-value storage in React Native apps using react-native-mmkv.

172|8|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/margelo/react-native-skills --skill react-native-mmkv-margelo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-native-mmkv
Source: https://github.com/margelo/react-native-skills/tree/main/skills/react-native-mmkv
Command: npx skills add https://github.com/margelo/react-native-skills --skill react-native-mmkv-margelo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires react-native-mmkv, react-native-nitro-modules, and includes references (resource) components.

What problem does it solve? React Native developers need fast, synchronous local storage, but AsyncStorage is slow and asynchronous, and the react-native-mmkv V4 rewrite introduced breaking API changes that cause confusion and bugs. ## Core Features & Use Cases - Instance Configuration & CRUD: Create and configure MMKV instances with createMMKV(), then read and write strings, numbers, booleans, buffers, and JSON objects synchronously. - Reactive Hooks & Listeners: Use hooks like useMMKVString and useMMKVObject for reactive UI, plus addOnValueChangedListener for non-React observation. - Encryption, Migration & Integrations: Encrypt storage with AES-128/AES-256, migrate data from AsyncStorage, and wire adapters for zustand, redux-persist, jotai, and react-query. - Use Case: A developer upgrading an app from AsyncStorage asks how to persist zustand state with MMKV; the Skill routes to the state-management reference and produces a correct StateStorage adapter using storage.set, storage.getString, and storage.remove. ## Quick Start Ask how to create an MMKV instance and persist a value in your React Native app, and the Skill will load the matching reference and produce correct V4 API code.

Frequently Asked Questions about react-native-mmkv

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use react-native-mmkv for key-value storage in React Native?

Create an instance with createMMKV() and call synchronous methods like storage.set('key', value) and storage.getString('key'). No await is needed because MMKV memory-maps its file and reads and writes in-process.

How do I persist zustand state with MMKV?

Create a StateStorage adapter mapping setItem to storage.set, getItem to storage.getString, and removeItem to storage.remove, then pass it to zustand's persist middleware via createJSONStorage. The same adapter pattern works for redux-persist, jotai, and react-query.

What changed in react-native-mmkv V4?

V4 replaced new MMKV() with the createMMKV() factory, renamed .delete() to .remove(), replaced the Mode enum with string literals, and requires react-native-nitro-modules as a peer dependency. Existing data files are preserved, so only API calls need updating.

Does react-native-mmkv support encryption?

Yes, MMKV supports AES-128 and AES-256 encryption set via the encryptionKey config option or by calling storage.encrypt(key) at runtime. Encryption is not supported on web, and keys are limited to 16 bytes for AES-128 and 32 bytes for AES-256.

How do I migrate from AsyncStorage to MMKV?

Run a one-time batch migration: read all keys with AsyncStorage.getAllKeys and multiGet, write each value into MMKV, remove them from AsyncStorage, then set a completion flag in MMKV so the migration never reruns. Replace await calls with synchronous MMKV getters afterward.

What is the storage size limit of MMKV?

MMKV has no fixed storage limit, but because it memory-maps the entire file, total size should stay under roughly 100 MB to avoid memory warnings and slow writes. For larger datasets, use a database such as react-native-nitro-sqlite or WatermelonDB.