Install
openclaw skills install react-patternsDeep React patterns workflow—component boundaries, composition, hooks rules, effects and data fetching, performance (memo, lists, suspense), testing, and accessibility. Use when structuring React apps, reviewing component design, or debugging re-renders.
openclaw skills install react-patternsHealthy React codebases emphasize clear data flow, minimal effects, and predictable rendering. Prefer composition over inheritance; treat effects as synchronization, not “do something after render” for everything.
Trigger conditions:
Initial offer:
Use six stages: (1) structure & boundaries, (2) state & data sources, (3) hooks discipline, (4) effects & events, (5) performance, (6) testing & a11y). Confirm React version and framework (plain CRA, Vite, Next App Router).
Goal: Colocate state; split presentational vs container only when it clarifies—not by default.
use client at leavesGoal: Local state for UI; server state via React Query/SWR/Apollo as appropriate; avoid duplicating server entities in global stores without sync rules.
Goal: Rules of Hooks satisfied; custom hooks encapsulate reusable stateful logic with clear inputs/outputs.
useThing; return stable APIs (objects memoized when needed)Goal: Prefer event handlers for user-driven work; useEffect for sync with external systems (subscriptions, non-React widgets).
Goal: Measure before memo; virtualize long lists; code-split routes.
useCallback/useMemo when profiling shows benefit—not by defaultGoal: React Testing Library user-centric queries; focus management and labels for forms.