react-native-mmkv
Version:
⚡️ The fastest key/value storage for React Native.
13 lines (12 loc) • 396 B
JavaScript
import { createMMKVHook } from './createMMKVHook';
/**
* Use the string value of the given `key` from the given MMKV storage instance.
*
* If no instance is provided, a shared default instance will be used.
*
* @example
* ```ts
* const [username, setUsername] = useMMKVString("user.name")
* ```
*/
export const useMMKVString = createMMKVHook((instance, key) => instance.getString(key));