💾 Storage & State Persistence
The AppCatalyst RN Starter Kit utilizes the highly performant react-native-mmkv for all synchronous, persistent storage needs. This library offers best-in-class read/write speeds, which is essential for a smooth user experience.
🚀 MMKV Storage Utility
We include a simple storage utility that wraps the core MMKV instance, providing clean, synchronous methods for storing and retrieving JSON-compatible data.
- Technology:
react-native-mmkv(High-performance C++ key-value storage). - Benefits: Offers up to 30x faster read/write times compared to
AsyncStorage.
Basic Usage
import { MMKV } from 'react-native-mmkv';
// Global instance used for all storage operations
export const storage = new MMKV();
// Utility methods for getting, setting, and removing JSON data
export function getItem<T>(key: string): T { ... }
export async function setItem<T>(key: string, value: T) { ... }
export async function removeItem(key: string) { ... }