I am trying to save data in AsyncStorage
in react-native
. I want to save it asynchronous so using async
and await
keyword
Async named arrow function should be declared like
const onPositiveClickListener = async () => {
// user has completed product tour_end
try {
await AsyncStorage.setItem("@ProductTour:key", "true");
const { navigate } = this.props.navigation;
navigate("DashboardScreen");
} catch (error) {
console.log(error);
}
};