React Native Storage - v2.0.0
    Preparing search index...
    • Reads an item and re-renders when it changes, from this component, another component or, for drivers that report it, outside the app's JavaScript.

      With a synchronous driver (MMKV, localStorage, memory) the stored value is there on the first render. With an asynchronous one (AsyncStorage, SecureStore) the first render has the default value and status: 'loading'.

      const [theme, setTheme] = useStorageItem(themeItem);
      

      Type Parameters

      • T

      Parameters

      Returns [value: T, setValue: SetStorageValue<T>, state: StorageItemState]