Redux Persist FS Storage
Redux Persist storage engine for React Native file system
yarn add react-native-fs redux-persist-fs-storage
This will install
react-native-fs as dependency. So make sure to link it natively:
react-native link react-native-fs
react-native-fs's documentation for details.
Both Redux Persist v4 and v5 are supported.
Redux Persist v5:
;;const persistConfig =key: 'root'keyPrefix: '' // the redux-persist default is `persist:` which doesn't work with some file systemsstorage:;const persistedReducer = ;const store = ;const persistor = ;
Redux Persist v4:
;;const persistor = ;
The default storage location is a folder called
reduxPersist in the document directory for your app on the device. You can specify folder for persistor:
;;const cachePersistor =;
This will create
myApp folder in cache storage for iOS and Android devices. You may create multiple persistors on different directories.