Skip to content

Modern React principles covering component design, hooks, state selection, composition, performance, and TypeScript typing.

CCM score
56 of 100
skills.sh installs
503
GitHub stars
34.3K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers component types (server, client, presentational, container), hook extraction rules, and state management selection by complexity
  • Includes React 19 guidance on useActionState, useOptimistic, and use, plus compound component and render prop composition patterns
  • Enforces a profile-first optimization order and lists anti-patterns such as prop drilling, index-as-key, and overusing useEffect
  • Designed for React teams writing TypeScript who want consistent architectural decisions across components, state, and tests

Install

$ npx -y skills add davila7/claude-code-templates --skill react-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

React Patterns

Principles for building production-ready React applications.


1. Component Design Principles

Component Types

TypeUseState
ServerData fetching, staticNone
ClientInteractivityuseState, effects
PresentationalUI displayProps only
ContainerLogic/stateHeavy state

Design Rules

  • One responsibility per component
  • Props down, events up
  • Composition over inheritance
  • Prefer small, focused components

2. Hook Patterns

When to Extract Hooks

PatternExtract When
useLocalStorageSame storage logic needed
useDebounceMultiple debounced values
useFetchRepeated fetch patterns
useFormComplex form state

Hook Rules

  • Hooks at top level only
  • Same order every render
  • Custom hooks start with "use"
  • Clean up effects on unmount

3. State Management Selection

ComplexitySolution
SimpleuseState, useReducer
Shared localContext
Server stateReact Query, SWR
Complex globalZustand, Redux Toolkit

State Placement

Details

Repository
github.com/davila7/claude-code-templates
Category
Frontend & UI Code
First seen
Jun 3, 2026

More from davila7/claude-code-templates

All 398

Similar to React Patterns

More Frontend & UI Code