Skip to content

Fix React Effect remount guidance #10

Description

@lidorcg

Problem

skills/.curated/react/references/conc-concurrent-safe.md recommends an empty-dependency Effect with a ref-guarded body for "once on mount" intent.

In development Strict Mode, React deliberately runs an extra setup → cleanup → setup cycle. A ref guard can suppress the second setup after cleanup, leaving the external synchronization torn down.

Proposed correction

Keep this change narrowly scoped to the canonical-resolution paragraph:

  • synchronization with external systems uses an Effect with complete dependencies and cleanup that mirrors setup;
  • app initialization runs at module scope or in a framework boot hook; and
  • Effects remain correct across setup → cleanup → setup instead of suppressing remount setup with a ref guard.

Official references:

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