Skip to content

Timeout triggered after component was unmounted #10

@anttimann

Description

@anttimann

I'm using slider in a modal that will be removed when onSlideSuccess is executed. Problem is that timeout with setState is triggered 1 second after that. In my case component doesn't exist anymore and React complain about it:

Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the SlideButton component.

That timeout could be cleared with clearTimeout or fixed in some other way when React component is unmounted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions