Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

False positives with "Highlight Updates" #1290

Closed
@mikechabot

Description

@mikechabot

I've created a minimal application that manifests the problem I'm seeing.

ezgif com-video-to-gif

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions