gpt4 book ai didi

react-native - 等待在 react-native@0.50.1 的发布版本中不起作用

转载 作者:行者123 更新时间:2023-12-04 17:48:18 25 4
gpt4 key购买 nike

await 在调试版本中工作,但在发布版本中不工作。 react-native@0.50.1 会发生这种情况,但 react-native@0.48.4 不会。它发生在设备和模拟器上。我看到了第一个日志,但没有看到第二个:

console.log('before await')
const value = await AsyncStorage.getItem(key)
console.log('after await value: ' + value)

我尝试使用不同的build设置来进行死代码剥离、位码和性能优化,但没有帮助。

可能是什么原因?也许有 babel 的东西?还是我必须调整代码才能使用“then”?

AsyncStorage.getItem(key).then(...

谢谢!

最佳答案

我遇到了同样的问题。我解决了它更新为:

  • “ react ”:“16.2.0”
  • “ native react ”:“0.52.0”

https://facebook.github.io/react-native/docs/upgrading.html

关于react-native - 等待在 react-native@0.50.1 的发布版本中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47168130/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com