AsyncStorage is an unencrypted, asynchronous, persistent, key-value storage system that is global to the app. It should be used instead of LocalStorage. It is recommended that you use an abstraction on top of AsyncStorage instead of AsyncStorage directly for anything more than light usage since it operates globally.
Installation
Importing the legacy version of theAsyncStorage library:
AsyncStorage was recently removed from the mainline React Native libraries. We are working on creating a path to use AsyncStorage more idiomatically. Until this is completed, include AsyncStorage in place of the import as follows:
AsyncStorage as type any, thus any related code will have relaxed type checking.
Persisting data:
API reference
getItem()
key and invokes a callback upon completion. Returns a Promise object.
Parameters:
setItem()
key and invokes a callback upon completion. Returns a Promise object.
Parameters:
removeItem()
key and invokes a callback upon completion. Returns a Promise object.
Parameters:
clear()
AsyncStorage for all clients, libraries, etc. You probably don’t want to call this; use removeItem or multiRemove to clear only your app’s keys. Returns a Promise object.
Parameters:
multiGet()
key inputs. Your callback will be invoked with an array of corresponding key-value pairs found:
Promise object.
Parameters:
multiSet()
Promise object.
Parameters:
multiRemove()
keys array. Returns a Promise object.
Parameters:

