Skip to content

useEffect didn't run in some rare case (lazy + memo) #4631

Open
@guoyunhe

Description

  • Check if updating to the latest Preact version resolves the issue

Describe the bug

I have a simple app with the following structure:

  • App (suspense)
    • Foobar (lazy)
      • Foo (memo)
      • Bar (lazy)

I found that in this case, Foo's useEffect() will NOT be executed. (But it does in React 18)

To Reproduce

https://codesandbox.io/p/sandbox/preact-memo-gpmrxk

Expected behavior

Show foobar

Actual behavior

Show bar

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions