npm react-native-async-storage
npm install @react-native-async-storage/async-storage
npm react-native-async-storage
npm install @react-native-async-storage/async-storage
async storage react native
import AsyncStorage from '@react-native-async-storage/async-storage';
// store item
export const storeData = async (key, value) => {
try {
await AsyncStorage.setItem(key, value);
return {
success: true
}
} catch (error) {
return {
success: false,
error
}
}
}
// get item
export const getData = async (key) => {
try {
const value = await AsyncStorage.getItem(key)
return {
success: true,
value
}
} catch(error) {
return {
success: false,
error
}
}
}
export default {
getData,
storeData
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us