Skip to content

throwing in useEffect causes subsequent effects to queue and never fire #2192

@tyler-graham-ck

Description

@tyler-graham-ck

After causing an exception in an effect an app will continue to render, however, subsequent useEffect calls queue but do not fire.

With a little investigation it appears that the afterPaint function is getting into a weird state. The effects continue to get queued up so the length is never one and thus flushAfterPaintEffects is not called (while tracing in my actual code the raf always appeared to be undefined).

Here's a codesandbox reproducing the issue and has some further exposition.

Note: codesandbox seems to have issues resolving preact/compat sometimes. Hard reload the sandbox when this 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