集成Redux Toolkit后Expo生产环境崩溃问题求助
Expo生产环境中Redux Provider引发应用崩溃问题
我在React Native项目中集成了react-redux与@reduxjs/toolkit,开发模式下运行完全正常,但执行expo start --no-dev --minify启动生产模式时应用直接崩溃,发布后的App启动也会崩溃。
注释掉以下代码中的Provider相关部分后,App不再崩溃:
const App = () => { return ( <Provider store={store}> <Router /> </Provider> ); };
我的package.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 }
我使用的是Expo SDK 46和expo-cli 6.0.6,请问是哪里遗漏了配置导致的崩溃?
内容的提问来源于stack exchange,提问作者Jim
相关产品推荐
相关产品推荐

