【问题标题】:Already installed @react-native-async-storage/async-storage with expo install but deprication warning won't go away已经使用 expo install 安装了 @react-native-async-storage/async-storage 但贬值警告不会消失
【发布时间】:2021-11-23 21:38:37
【问题描述】:

我在 React Native Expo 中有这个警告:AsyncStorage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-async-storage/async-storage' instead of 'react-native'. See https://github.com/react-native-async-storage/async-storage

我已经安装了@react-native-async-storage/async-storageexpo install,但警告不会消失。

搜索我的文件显示没有结果 AsyncStorage 我做错了什么,请指教

"dependencies": {
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/native-stack": "^6.2.5",
    "expo": "~43.0.2",
    "expo-firebase-recaptcha": "~2.0.2",
    "expo-status-bar": "~1.1.0",
    "firebase": "^9.5.0",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-native": "0.64.3",
    "react-native-safe-area-context": "3.3.2",
    "react-native-screens": "~3.8.0",
    "react-native-web": "0.17.1",
    "react-native-webview": "11.13.0"
  }

【问题讨论】:

  • 如何导入以及如何调用它?
  • 我没有在我的应用程序的任何地方使用它,我不明白警告来自哪里
  • 删除节点模块:rm -r 节点模块。然后删除文件夹 expo 并再次运行 yarn 或 npm install
  • 完成了,没有帮助,我仍然有警告
  • @DeonDazy 你介意列出你的应用程序的依赖项吗?

标签: firebase react-native expo


【解决方案1】:

我们可能面临同样类型的问题 :( 它与 Firebase 包有关。这是一个讨论潜在解决方案的线程。不幸的是,我不认为它是固定在 Firebase 方面的..

https://github.com/firebase/firebase-js-sdk/issues/1847

【讨论】:

  • 我想解决办法是不使用 Expo?
  • 如果您不使用 Expo,您将能够链接您的包.. 所以也许。但是,问题来自使用已弃用的 AsyncStorage 版本的 Firebase。希望他们会升级它,它应该可以解决问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-11-04
  • 1970-01-01
  • 2019-08-20
  • 2017-10-31
  • 2021-02-16
  • 2019-10-08
  • 1970-01-01
相关资源
最近更新 更多