react
React
Guidance for plain, client-side React (Vite SPA, CRA-style, or any non-framework React app). Server Components, streaming SSR, and the App Router are Next.js/Remix framework features, not plain React APIs — they do not apply here. If the project uses Next.js, defer to the nextjs-* skills in this library for anything routing/data-fetching/RSC-related; use this skill only for generic component/hook patterns.
Precondition: Before asserting a hook or API is available (use(), useOptimistic, useActionState, useFormStatus), verify the installed React version — these are React 19+ only.
grep '"react"' package.json
npm ls react react-dom
Canonical source for anything not covered below: https://react.dev. Training data on React APIs may be stale — verify against the docs rather than inventing hook signatures.
Core Patterns
Function components + hooks (the only current pattern)
Class components are legacy; do not write new ones. Only touch existing class components if already in scope for other reasons.