react-idioms
React Idioms and Patterns
Core Philosophy
React 19+ rewards composition, hooks, and server-aware patterns. Idiomatic React = functional, performant, accessible. Prefer co-located features, custom hooks for logic reuse, and server state libraries over hand-rolled fetch logic.
Scope: This file covers React-specific coding idioms for components, hooks, state, routing, and forms. For TypeScript type system patterns, see
@.agents/skills/typescript-idioms/SKILL.md. For file and folder layout, seereferences/project-structure.md(and the shared@.agents/skills/frontend-design/references/frontend-layout.md). For general frontend design, see@.agents/skills/frontend-design/SKILL.md.Loading guard: If the project uses Next.js (App Router —
app/dir ornext.config.*), load@.agents/skills/nextjs-idioms/SKILL.mdinstead of this skill for App-Router-specific patterns. This skill still applies to client components and pure-React (Vite) SPAs.
When to Load References
Load these before writing code in the matching context — not after.