react/SKILL.md
React — JavaScript library for building user interfaces with components. Use when building with React or asking about hooks, state management, effects, Server Components, Suspense, or any React APIs, patterns, or configuration. Fetch live documentation for up-to-date details.
npx skillsauth add mikkelkrogsholm/dev-skills reactInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
CRITICAL: Your training data for React is unreliable. APIs change between versions and memorized patterns may be wrong or deprecated. Before writing any code, you MUST use
WebFetchto read the live docs:
WebFetch("https://react.dev/llms.txt")Do not proceed without fetching this URL first. Never assume a hook or API exists — verify against current docs.
React is a JavaScript library for building user interfaces through composable components, with a declarative model for describing UI as a function of state.
React has built-ins for things developers commonly reach for external packages to solve:
useId() — not uuid or Math.random() for linking labels to inputsuseDeferredValue() or useTransition() — not lodash debounce for keeping UI responsive during expensive rendersReact.lazy() + <Suspense> — no extra bundler plugins or dynamic import wrappers neededuseOptimistic() (React 19+) — not manual state juggling for instant feedback before server confirmsuseSyncExternalStore() — not custom subscription hooks that miss concurrent-mode edge casesuseActionState() (React 19+) — not separate loading/error/data useState triplets for form submissionsuseMemo/useCallback everywhere; the compiler handles it automaticallysetState returns the old value. Use the functional updater form setState(prev => ...) when the new value depends on the previous, and read updated values in the next render, not inline.useEffect intentionally runs twice in StrictMode — React mounts, unmounts, then remounts in development to expose missing cleanup. This is not a bug; always return a cleanup function from effects with subscriptions, timers, or event listeners.key breaks state preservation on reorder/filter. Always use a stable ID from the data (e.g., item.id).'use client' placement matters for Server Components — placing the directive at a layout or page root converts the entire subtree to client code, eliminating Server Component benefits. Push 'use client' as far down the tree as possible, to the smallest interactive leaf components.development
Zod — TypeScript-first schema validation with static type inference. Use when building with Zod or asking about schema definitions, type inference, parsing, transformations, refinements, coercion, error handling, or integration with forms, APIs, or tRPC. Fetch live documentation for up-to-date details.
tools
Vite — next-generation frontend build tool with instant dev server and optimized production builds. Use when building with Vite or asking about its APIs, configuration, plugins, SSR, environment variables, or integration with frameworks. Fetch live documentation for up-to-date details.
tools
Upstash — serverless Redis, QStash, and Vector database with per-request pricing optimized for edge and serverless environments. Use when building with Upstash or asking about its Redis client, QStash message queuing, rate limiting, workflows, or vector search. Fetch live documentation for up-to-date details.
tools
Turso — edge-hosted SQLite database built on libSQL with embedded replicas, multi-tenancy, and low-latency global distribution. Use when building with Turso or asking about its libSQL client, embedded replicas, database-per-tenant patterns, auth tokens, sync, or integration with Drizzle or other ORMs. Fetch live documentation for up-to-date details.