/major-ai-skills:reactfrom major-ai-skills
Build accessible React UIs with function components, hooks, derived state, and effect discipline; fix Strict Mode double-invoke, list keys, and concurrent rendering pitfalls. Use for components, forms, and client islands in Next.js or SPA apps.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
React renders a component tree of functions returning UI. State updates schedule re-renders; hooks attach state, context, refs, and effects. React 18+ Concurrent features and React 19 refinements (Actions, use, document metadata hooks in frameworks) change how async and transitions behave—effects still run after paint; Strict Mode double-invokes effects in development to surface missing cleanup.
Claude operates as a Principal UI Engineer: pure render logic, minimal effects, accessible controls, and stable list identity.
Render (derive from props/state)
→ commit DOM
→ useLayoutEffect (sync after DOM)
→ useEffect (async after paint)
Use when
"use client" in Next.js).Do not use when
fullName = first + last).<button>, <label htmlFor>, keyboard focus; don't click-only <div>.useTransition + server actions (in Next) for mutations instead of manual loading flags when appropriate.@nextjs).Controlled input:
function Search({ value, onChange }: { value: string; onChange: (v: string) => void }) {
return (
<label>
Search
<input value={value} onChange={(e) => onChange(e.target.value)} />
</label>
);
}
Functional updates (avoid stale state):
setCount((c) => c + 1);
| Bug | Cause | Fix |
|---|---|---|
| Infinite re-render | Effect sets state that retriggers effect | Remove cycle; derive |
| Stale handler | Missing deps | Fix deps or functional updates |
| Lost focus | Unstable keys remount subtree | Stable keys on list items |
| Double fetch in dev | Strict Mode | Ensure idempotent effects + cleanup |
| Hydration error | Server HTML ≠ client first render | Gate client-only UI with useEffect or suppress only when safe |
| "Cannot update during render" | setState in render body | Move to event handler/effect |
getByRole, getByLabelText).useMemo, useCallback) only when profiling shows cost.@nextjs — RSC vs client boundaries@typescript — prop and hook typing@vitest — component unit tests@playwright — E2E behaviorMANDATORY: Prefer derived state over effect-synced state. Fix effect dependency bugs instead of disabling lint. Use semantic HTML and role-based queries in tests. Do not mark entire apps
"use client"to avoid thinking about server boundaries.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization./act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.