Skip to main content
Run any Skill in Manus
with one click

react-effect-sync-cached-state

Stars7
Forks0
UpdatedApril 24, 2026 at 23:39

When a React component owns cached state in an imperative library (CodeMirror EditorView, canvas, D3, monaco) or a ref mirroring server state, every effect branch that re-reads the source must also sync the cached copy. Optimistic updates stay cached until refetch resolves. NaN-derived values are guarded before equality checks. `.map()` of multi-element rows wraps in a KEYED `<Fragment>` — the key on an inner element does not satisfy React. Trigger when editing components that host imperative editors (SourceTab), chat mutations, URL-param-driven activeId state, or any table/list where `.map()` returns multiple siblings per iteration.

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

SKILL.md
readonly