我在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-storage
与expo 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"
}
2条答案
按热度按时间62lalag41#
尽管这是firebase软件包内部导入AsyncStorage的问题,但有一个解决方案可以让您暂时清除该警告,直到firebase正确导入AsyncStorage。解决方案使用auth模块中的getReactNativePersistence()方法。
我们可以使用这个方法来传递AsyncStorage的正确导入,这样firebase就不需要从
react-native
内部导入它,从而修复这个警告。采用自:Firebase问题1847 #问题注解-1041548028
mcdcgff02#
我们可能会面临同样类型的问题:(这是有关Firebase包。这里是一个线程,讨论潜在的解决方案。我不认为它是固定在Firebase的一方不幸的是...
https://github.com/firebase/firebase-js-sdk/issues/1847