【发布时间】:2019-03-06 16:33:54
【问题描述】:
首先,问题出现在ios模拟器下(所有虚拟设备)。
依赖关系: @remobile/react-native-toast": "^1.0.7" “反应原生”:“0.56.0”...
问题描述: 我在这样的异步方法中模拟 api 错误:
async getData() {
await MyApi.myMethod(...).catch(() => {
Toast.showLongTop(myToastMessage);
});
// Here a toast would be displayed correctly
}
即使通过.catch(),toast 通知也不会显示。
感谢您的帮助!
【问题讨论】:
标签: react-native async-await toast catch-block