question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 4 years ago
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AdamJNavarrocommented, Mar 27, 2019

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.

1reaction
AdamJNavarrocommented, Mar 27, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found