You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is related/displaying similar behavior to #1599.
In this example, our parent component consumes a value from the store, and a child component on componentDidMount and componentDidUpdate calls an action to update that value multiple times. We see the child component receives the updated value, while the parent component does not after the first update. The parent component's useSelector instance doesn't invoke the selector function and just returns the cached value.
We would expect the parent component's useSelector instance to return the same value from the store as the child component's
Which versions of React, ReactDOM/React Native, Redux, and React Redux are you using? Which browser and OS are affected by this issue? Did this work in previous versions of React Redux?
The versions used in the code sandbox are:
react: 16.13.1
react-dom: 16.8.3
react-redux: 7.1.3
redux: 4.0.5
The text was updated successfully, but these errors were encountered:
I'm going to close this as a WONTFIX for now, largely because we're encouraging folks to stop using connect (even though it'll be fully supported in v8). This is a real bit of behavior that I can understand is annoying, but I don't think there's a meaningful change we can make at this point, and I don't intend to spend time fixing it myself.
If someone still feels strongly about this please comment, or even better file a PR to improve behavior here.
What is the current behavior?
This is related/displaying similar behavior to #1599.
In this example, our parent component consumes a value from the store, and a child component on componentDidMount and componentDidUpdate calls an action to update that value multiple times. We see the child component receives the updated value, while the parent component does not after the first update. The parent component's useSelector instance doesn't invoke the selector function and just returns the cached value.
https://codesandbox.io/s/race-condition-x1h1d
What is the expected behavior?
We would expect the parent component's useSelector instance to return the same value from the store as the child component's
Which versions of React, ReactDOM/React Native, Redux, and React Redux are you using? Which browser and OS are affected by this issue? Did this work in previous versions of React Redux?
The versions used in the code sandbox are:
react: 16.13.1
react-dom: 16.8.3
react-redux: 7.1.3
redux: 4.0.5
The text was updated successfully, but these errors were encountered: