Waiting for AsyncStorage.getItem()

You can try either add a then after your getItem.

AsyncStorage.getItem("phoneNumber").then((value) => {
    this.setState({"phoneNumber": value});
})
.then(res => {
    //do something else
});

Or use await to wait the async operation to finish

var value = await AsyncStorage.getItem(STORAGE_KEY);
//use value to do something else.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)