useSelector(..) causing twice render - event the selected state doesn't change
What is the current behavior?
Hello guys,
I have some problems with the useSelector. It causes twice render of component.
In a nut shell
store = {
en1: 'A',
en2: 'B'
}
actions: {
changeEN1()
}
<ReactReduxProvider>
| - EN1 (useSelector)
| - EN2 (useSelector)
| - EN1Connect (connect)
When I click a button in EN1, it will re-render EN1 twice, but EN1Connect only once. So I think we have the problem with useSelector. The Sandbox Link: https://codesandbox.io/s/awesome-zhukovsky-w82pb?file=/src/App.js .
After checking the source code, i think this is the reason. Please help me take a look:

What is the expected behavior? It should render only once when the state changes.
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?
I found the reason ..
Due to React.StrictMode problems.
Thanks guys.