api - React Native fetch API错误 - 页面不断刷新
解决方案
componentDidMount
正在返回而不处理 Promise。
无论如何,您不必退回任何东西componentDidMount
。所以你可以有
componentDidMount() {
fetch(...).then(res => res.json()).then((jsonRes) => {})
}
或者使用异步/等待
推荐阅读
- python - python pandas:减去两个日期时间得到零
- r - Posixct 日期的条件
- javascript - Laravel如何在Javascript var中使用刀片代码?
- android - 滑动刷新布局不适用于 recyclerview
- r - 如何从简单的 tibble 中创建详细和分类的 tibble
- android - Android lint 在 Gitlab Runner (Docker) 上失败
- php - 在 WordPress 中注册新用户时如何添加自定义帖子类型?
- jenkins - 使用pytest在jenkins上使用颜色的实时控制台输出
- android - Flutter 应用程序崩溃(内部测试 google play 商店)但本地 apk 有效
- python - 在 Python 中处理 Azure Blob 删除客户端中 Blob 不存在场景的异常