aiskillstore/react-best-practices
Use when reading or writing React components (.tsx, .jsx files with React imports).
npx skills add https://github.com/aiskillstore/marketplace --skill react-best-practices
When working with React, always load both this skill and typescript-best-practices together. TypeScript patterns (type-first development, discriminated unions, Zod validation) apply to React code.
Effects let you "step outside" React to synchronize with external systems. Most component logic should NOT use Effects. Before writing an Effect, ask: "Is there a way to do this without an Effect?"
useMemokey propuseEffectEventSynchronizing with external systems: browser APIs (WebSocket, IntersectionObserver), third-party non-React libraries, window/document event listeners, non-React DOM elements (video, maps).
useMemokey propref.current during render; only in event handlers and effectsuseRef in loops) for dynamic listsuseImperativeHandle to limit what parent can accessuseXxx only if it actually calls other hooks; otherwise use a regular functionuseMount, useEffectOnce) — use useEffect directly so the linter catches missing depschildren over prop drillingisEditing, isThread, hideAttachments) as a composition smell; prefer separate composed components for distinct use casesflushSync when you need to read the DOM synchronously after a state updateSee react-patterns.md for code examples and detailed patterns.
Take aiskillstore/react-best-practices from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.