Command Palette

Search for a command to run...

Back to skills
skill № 51808

React

Builds, debugs, and reviews React apps: components, hooks, state, Server Components, forms, performance, testing. Use when writing or refactoring components…

FreeNo executable scripts
clawicby clawic★ 23 GitHub stars

Install React in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

User preferences and memory live in ~/Clawic/data/react/ (see setup.md on first use, memory-template.md for the file format). If you have data at an old location (~/react/ or ~/clawic/react/), move it to ~/Clawic/data/react/, and say in one line that you moved it and from where.

When To Use

  • Building React components, features, or app architecture
  • Choosing or wiring state (useState, Context, Zustand, TanStack Query)
  • Working with React 19: Server Components, use(), Actions, React Compiler
  • Debugging rerenders, infinite loops, stale closures, hydration errors, racing fetches
  • Testing components, typing props, migrating legacy React code
  • Reviewing AI-generated React for the failure patterns listed here
  • Not for routing/deployment specifics (nextjs skill) or mobile (react-native skill)

Quick Reference

Situation Play
Data comes from an API TanStack Query — never useState + useEffect fetch (state.md)
UI state shared across components Zustand slice, read via selectors only (state.md)
State used by one component useState, colocated; lift at the second consumer, not before
Rarely-changing globals (theme, locale, auth identity) Context with memoized value; split state and dispatch contexts
Filters, tabs, page number the user could bookmark URL searchParams, not useState (state.md)
Form with validation React Hook Form + Zod (uncontrolled: keystrokes don't rerender); server mutation → useActionState (forms.md)
Typing lags in a filtered view useDeferredValue around the value you receive; startTransition around state you set
List with thousands of rows Virtualize (tanstack-virtual) — DOM node count is the cost, not data size
Component must reset when identity changes Change its key: <Profile key={userId} /> — remount beats manual state clearing
Multi-step flow / wizard One discriminated-union status field, not a pile of booleans (forms.md)
A crash blanks the whole app react-error-boundary per route and per risky feature
Same component commits repeatedly, props unchanged Profile before touching code (performance.md)
Infinite loop, stale state, hydration error Symptom chains in debug.md
Class components, forwardRef, PropTypes in the codebase migration.md before adding features on top
Anything else / unsure useState colocated, named export; extract when a second consumer appears

Depth on demand: debug.md symptom→cause chains · state.md server/client/URL state · server-components.md RSC boundaries and Actions · hooks.md effect discipline, refs, custom hooks · performance.md profiling and fixes in priority order · forms.md validation, wizards, uploads · testing.md Testing Library, MSW, async · typescript.md typing patterns · accessibility.md focus, ARIA, keyboard · migration.md upgrades and legacy code · setup.md scaffolding and recommended stack.

Core Rules

  1. Server state ≠ client state. API data lives in TanStack Query (a cache with a lifecycle); UI state in useState/Zustand. Mixing them means hand-rebuilding dedupe, caching, and invalidation — badly.
  2. No effect without an external system. Derivable from props/state → compute in render: const total = items.reduce(...). Before writing useEffect ask "what outside React am I synchronizing with?" No answer → no effect (hooks.md for the full replacement table).
  3. 'use client' marks a boundary, not a component. Everything that file imports joins the client bundle. Put it on leaf interactive components; pass Server Components through as children.
  4. Stable keys — and keys as a tool. key={item.id} for lists; deliberately changing a key is the sanctioned way to reset component state.
  5. Named exports only. export function UserCard — rename refactors stay safe, imports stay greppable.
  6. Memoize by evidence. React Compiler on: write no memo/useMemo/useCallback by hand — the compiler bails out on components that break the Rules of React, it doesn't fix them. Compiler off: memoize only after the Profiler shows the same component committing repeatedly with unchanged props.
  7. strict: true plus noUncheckedIndexedAccess. With it, array[0] is T | undefined — the "impossible" runtime crash becomes a compile error.
  8. Split at ~50 lines of JSX or ~300 lines per file (house default, not dogma): past that, the extraction candidates are already visible in the markup.

Error Messages Decoded

Error Cause First move
"Too many re-renders" setState called during render, unconditionally Find the bare setX(...) in the body or an onClick={fn()} call instead of onClick={fn}
"Rendered more hooks than during the previous render" Conditional hook, or early return above a hook Move every early return below the last hook (Component Rules)
"Invalid hook call" Hook outside a component/custom hook
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

  • _meta.json
  • memory-template.md
  • setup.md

FAQ

What does the React skill do?

Builds, debugs, and reviews React apps: components, hooks, state, Server Components, forms, performance, testing. Use when writing or refactoring components, choosing state management (useState, Context, Zustand, TanStack Query, Redux), when a component rerenders too often, loops infinitely ("too many re-renders"), shows stale or not-updating state, fails with a hydration mismatch or hook-order error, when an effect fires twice or fetches race, when typing lags or long lists scroll slowly, when adopting React 19, Server Actions, or the React Compiler, when testing components with Testing Library, typing props in TypeScript, or reviewing AI-generated React code. Not for React Native (mobile) or Next.js routing and deployment — use react-native or nextjs.

How do I install the React skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the React skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare React with