Closed
Description
What version of React, ReactDOM/React Native, Redux, and React Redux are you using?
- React: 18.2.0
- ReactDOM/React Native: 18.2.0
- React Redux: 8.0.5
What is the current behavior?
- Open the codesandbox ( https://codesandbox.io/s/elegant-hofstadter-i2h34h?file=/src/features/counter/InnerCounter.js )
- Open the page in a new browser window
- Click the "INCREMENT ME!" text
- If the number in the first row increments -> Full reload the page, repeat 3.
- The number does not increase although the store is updated (see console.log output) but the selector does not trigger
Additional note: This works correctly with react v17 (ReactDOM.render) and breaks in v18 (createRoot). I have also debugged the behavior and have seen that the Provider component is unmounted which removes the store subscriptions of the useSelector hooks. After the Provider mounts again, the subscriptions are not restored because the child components do not render again.
What is the expected behavior?
The number is increased on every click.
Which browser and OS are affected by this issue?
all
Did this work in previous versions of React Redux?
- Yes
Metadata
Metadata
Assignees
Labels
No labels