Importing AsyncStorage:

import { AsyncStorage } from "react-native"

Methods

setItem:( to store data )

the user is the key to the data stored we use that same key to retrieve the data from local storage. setItem(key: string, value: string)

2. getItem:( to get stored data )

an async keyword is used to write functions that handle asynchronous actions.

What happen there? simple as: try to get the data to wait until data retrieve from setItem key(userData) if data retrieves successfully alert the data if any error on retrieving data catch that error and alert the error.

The time comes will create a simple app which store data, retrieve data remove data we will be using three methods setItem(),getItem() and removeItem().

App summary: Input data> click to save data > click to retrieve data > click to delete data.

Our App

Here is the whole code for this app go over the code. i don’t need to explain the code its very simple and easy to understand read the code and write and run in your device.i will give the screenshot of how app works