Skip to content

Fundamentally broken #1

@EmielM

Description

@EmielM

In react strict-mode, hooks are sometimes executed a second time to check if the output is pure & the same (in some weird ass mode where console.log is overridden to hide log side effects).

This is however a fundamental issue with useImmediateEffect implementations, as the immediate effect is run again in this mode, and almost always has side effects.

Not sure this can be fixed. Leaving this here as a warning for others as it took me half a day to figure out what was going on.

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