This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// React Native component | |
const value = { | |
name: "Chimezie", | |
job: "Software Developer" | |
}; | |
const storeUser = async () => { | |
try { | |
await AsyncStorage.setItem("user", JSON.stringify(value)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setItem() | |
getItem() | |
mergeItem() | |
removeItem() | |
multiGet() | |
clear() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// React Native component | |
import AsyncStorage from '@react-native-async-storage/async-storage'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# using npm | |
npm install @react-native-async-storage/async-storage | |
# using Yarn | |
yarn add @react-native-async-storage/async-storage | |
# using Expo CLI | |
expo install @react-native-async-storage/async-storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// storing data | |
const storeUser = async (value) => { | |
try { | |
await AsynStorage.setItem("user", JSON.stringify(value)); | |
} catch (error) { | |
console.log(error); | |
} | |
}; | |
// getting data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2020-03-22T04:20:15.321Z","extensionVersion":"v3.4.3"} |
NewerOlder