False positives with "Highlight Updates" #1290
Description
I've created a minimal application that manifests the problem I'm seeing.
Example app: https://pjl4y250lq.codesandbox.io/
Sandbox code: https://codesandbox.io/s/pjl4y250lq
Explanation of Problem
At its core, there are two (2) input fields: <Foo />
and <Bar />
, both of which are connected (via connect
) to the store, and each have selectors that grab just the bit of store they require to render. However, regardless of which input field is updated, both <Foo />
and <Bar />
are shown as updated in react-devtools
.
The components themselves aren't re-rendering, this can be evidenced by placing console statements in the render methods, however the shallow comparison in mapStateToProps
appears to be failing, hence react-devtools
showing the components are being updated.
Question
Are these false positives, or am I misunderstanding how connect
is expected to function with regard with rendering updates? Shouldn't the selectors in mapStateToProps
not invoke an update when the respective state chunk is not updated (i.e. update state.bar
but state => state.foo
fails to pass the shallow comparison)?
Dependencies
react: 16.5.2
react-dom: 16.5.2
redux: 4.0.1
react-redux: 6.0.0
redux-thunk: 2.3.0