Waiting for AsyncStorage.getItem()

前端 未结 2 1776
被撕碎了的回忆
被撕碎了的回忆 2020-12-17 08:36

I am using AsyncStorage in my React Native application to store information about the user. The getItem() function is asynchronous and requires me

2条回答
  •  独厮守ぢ
    2020-12-17 08:59

    try this option and you will not get the

    Syntax Error: Await is a reserved word

    async getData() {
        return await AsyncStorage.getItem("@App:KEY");
    }
    

提交回复
热议问题