首先,问题出现在ios模拟器下(所有虚拟设备)。
依赖项:@remobile/react-native-toast":"^1.0.7""react-native":"0.56.0"...
问题描述:我在这样的异步方法中模拟了一个 api 错误:
async getData() {
await MyApi.myMethod(...).catch(() => {
Toast.showLongTop(myToastMessage);
});
// Here a toast would be displayed correctly
}
并且 toast 通知不会显示自己,即使它确实通过.catch()
.
谢谢你的帮助!