【发布时间】:2018-02-03 02:22:06
【问题描述】:
我需要从异步存储中加载一个 URL,然后我需要对其进行处理。
async renderContent() {
const url = await AsyncStorage.getItem(Keys.url );
console.log("Got it url= "+url);
return url;
},
它给了我错误await is a reserved word。
更新: 现在它在没有 url 的情况下继续前进 Url got :(
【问题讨论】:
-
您是否将 async 关键字添加到包含您的 await 语句的函数名称中?
-
@SwiftsNamesake :添加了适当的标签。 @Patrick Hund:添加了我的全部功能
标签: javascript react-native async-await