expo: Redux don't update component in dev env
🐛 Bug Report
Environment
Expo CLI 2.13.0 environment info: System: OS: Windows 10 Binaries: npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
//package.json
"dependencies": {
"expo": "^32.0.6",
"react": "^16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.1.tar.gz",
"react-native-elevated-view": "0.0.6",
"react-native-gesture-handler": "^1.1.0",
"react-native-paper": "^2.12.0",
"react-native-responsive-dimensions": "^2.0.1",
"react-navigation": "^2.0.1",
"react-navigation-material-bottom-tabs": "^0.4.0",
"react-redux": "^6.0.1",
"redux": "^4.0.1"
},
Steps to Reproduce
Doing a mapStateToProps with a console.log for checking if component is updating with new props when dispatch.
const mapStateToProps = (state) => {
console.log("props updating")
return {
card: state.cardHandler.card
}
}
export default connect(mapStateToProps)(Item)
You can see this issue for more information and reproducing
https://stackoverflow.com/questions/55315191/connect-doesnt-refresh-when-state-change-on-react-native-with-redux/
Expected Behavior
Component with connect() should reload on store modification
Actual Behavior
Nothing happened on developpement mode, but if env is production, redux working and component update.
//settings.json
{
"hostType": "lan",
"lanType": "ip",
"dev": true, //working with false
"minify": false,
"urlRandomness": "53-g5j"
}
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (2 by maintainers)
Yes, sorry for the confusion. The phrase vanilla react native most often means a plain react-native project. You’ll want to follow the
React Native CLI Quickstart
guide here.Hey @Borrelli,
Before we investigate this, as I suspect it may not be Expo-related, can you try reproducing this issue in a vanilla React Native project and seeing if it still persists? If it works properly then please create a Snack with just the minimal code and dependencies required to reproduce the issue so we can debug on our end.
Cheers, Adam