我正在使用React Native 0.68.1和React 18,升级后出现此错误:
它可以很好地处理表示型组件,但是当我从“react-redux”切换到具有连接函数的智能组件时,它就会抛出上述错误。
我的包裹:
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "0.68.1",
"react-native-paper": "^4.12.0",
"react-native-safe-area-context": "^4.2.4",
"react-native-screens": "^3.13.1",
"react-native-vector-icons": "^9.1.0",
"react-native-web": "^0.17.7",
"react-redux": "8.0.1",
"@reduxjs/toolkit": "1.8.1",
2条答案
按热度按时间fumotvh31#
问题在于你的依赖性,React native目前只兼容react 17,所以你需要降级react,而且你可能需要卸载react-dom,因为你没有在浏览器中工作。
fwzugrvs2#
更改React还原版本==〉“React还原”:“^7.2.8”,