Redux don't update component in dev env
See original GitHub issue🐛 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"
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (2 by maintainers)
Top Results From Across the Web
Component not updating after action is dispatched - react-redux
I'm using react-native and am having an issue where my action is being dispatched and the reducer is modifying the state, however my...
Read more >Why isn't my React component updating (using Redux)?
And still the component is not updating. Your useSelector is subscribing to the value in the store, but its value is not updated...
Read more >5 Ways to Stop Wasting Renders in React/Redux - Medium
While learning React/Redux, I noticed some of my components were rendering many times, ... 1) Integrate why-did-you-update to your dev tools.
Read more >Understanding Redux: A tutorial with examples
With Redux, we can make state data independent of the components, and when needed, a component can access or update through the Redux...
Read more >How to Manage State in a React App – With Hooks, Redux ...
But thanks to state, React functional components can store ... which means that the second setCount won't update the state correctly.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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