Skip to content

componentWillUnmount should only ever be called once #6574

@jimfb

Description

@jimfb

Error boundries might help, if someone is using them, but if you're not using error boundaries we shouldn't ever attempt to unmount a single component instance more than once.

https://jsfiddle.net/fxq44m0t/

The only reason it's not an infinite loop is that we eventually run out of stack space :P. With good tail recursion in the JSVM, this could become an infinite loop.

Anyway, this is more than a contrived example, because the ReactRouter+redux combination creates situations where this type of thing happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions