Expo与redux工具包崩溃



我刚刚在react native上添加了带有reduxjs/toolkit的react redux。

我尝试了开发模式,它一直运行良好。我尝试了expo-start-no-dev-minimy,但它崩溃了。我决定发布它,当我启动它时,我的应用程序立即崩溃。

为什么?

软件包.json

{
"name": "cusual test",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"@react-native-picker/picker": "2.4.2",
"@react-navigation/bottom-tabs": "^6.4.0",
"@react-navigation/native": "^6.0.13",
"@react-navigation/native-stack": "^6.9.1",
"@reduxjs/toolkit": "^1.8.6",
"@types/axios": "^0.14.0",
"axios": "^1.1.3",
"eas-cli": "^2.5.1",
"expo": "~46.0.16",
"expo-status-bar": "~1.4.0",
"expo-updates": "~0.14.6",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "0.69.6",
"react-native-dotenv": "^3.3.1",
"react-native-picker-select": "^8.0.4",
"react-native-safe-area-context": "4.3.1",
"react-native-screens": "~3.15.0",
"react-native-vector-icons": "^9.2.0",
"react-native-web": "~0.18.7",
"react-redux": "^8.0.4"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@types/react": "~18.0.14",
"@types/react-native": "~0.69.1",
"@types/react-native-vector-icons": "^6.4.12",
"typescript": "~4.3.5"
},
"private": true
}

这句话让我的应用程序崩溃:

const App = () => {
return (
<Provider store={store}>
<Router />
</Provider>
);
};

如果我评论提供者的行,它就不会崩溃了。

我错过什么了吗?

我使用的是SDK 46和expo 6.0.6。谢谢你的帮助。

有同样的问题。看起来是由Redux代码中的错误引起的。看看GitHub:上的这个问题

https://github.com/reduxjs/redux/issues/4443

描述缩小代码并在生产模式下运行时发生的崩溃。

最新更新