Skip to content

mapStateToProps is called when component is not due to render when a dispatch is triggered from componentDidUpdate #1397

Closed
@ykagan

Description

@ykagan

When a dispatch is triggered from a lifecycle method as a side-effect of a re-render from a previous dispatch, we wind up calling mapStateToProps on components that are never going to be rendered and are about to be unmounted.

#1263 fixed a very similar issue when multiple dispatches are triggered simultaneously.

Minimal repro is here: https://codesandbox.io/embed/react-redux-issue-debug-rvr-8whlb

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