Skip to content

PureComponent not working with setState inside interval #8624

Closed
@davegri

Description

@davegri

Do you want to request a feature or report a bug?

Report a possible bug

What is the current behavior?

Calling setState (with new state) insider a setInterval callback does not cause a re-render when using PureComponent. I've tried logging the next and previous state inside shouldComponentUpdate and they show up as identical even though they shouldn't be.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/reactjs/69z2wepo/).

What is the expected behavior?

Component should update

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

Latest version

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions