Skip to content
affaan-m avatar

React Patterns

React 18/19 patterns that cover hooks discipline, RSC boundaries, Suspense, form actions, and state placement.

CCM score
73 of 100
skills.sh installs
8.5K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers render purity, side-effect placement, state location decisions, and data fetching choices for React components
  • Includes server/client component boundary rules, Suspense and error boundary placement, and React 19 useActionState form examples
  • Enforces derived values computed during render rather than stored in useEffect, and memoization only when a profiler justifies it
  • Designed for developers writing or reviewing React components in Next.js App Router or similar component trees

Install

$ npx -y skills add affaan-m/ecc --skill react-patterns -y

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

Files

React Patterns

Idiomatic React 18/19 patterns for building robust, accessible, performant component trees.

When to Activate

  • Writing or modifying React function components, custom hooks, or component trees
  • Reviewing JSX/TSX files
  • Designing state shape or component composition
  • Migrating class components or older forwardRef/useEffect-heavy code
  • Choosing between local state, lifted state, context, and external stores
  • Working with Server Components / Client Components (Next.js App Router, RSC)
  • Implementing forms with React 19 actions or controlled inputs
  • Wiring data fetching with TanStack Query / SWR / RSC

Core Principles

1. Render is a Pure Function of Props and State

// Good: derive during render
function Cart({ items }: { items: CartItem[] }) {
  const total = items.reduce((sum, i) => sum + i.price * i.qty, 0);
  return <span>{formatMoney(total)}</span>;
}

// Bad: derived state stored separately
function Cart({ items }: { items: CartItem[] }) {
  const [total, setTotal] = useState(0);
  useEffect(() => {
    setTotal(items.reduce((sum, i) => sum + i.price * i.qty, 0));
  }, [items]);
  return <span>{formatMoney(total)}</span>;
}

Details

Repository
github.com/affaan-m/ecc
Categories
Frontend & UI Code, Code Review & Quality
First seen
Jul 14, 2026

Questions

What does the react-patterns skill help with?

The react-patterns skill covers React 18 and 19 patterns, including hooks discipline, server and client component boundaries, Suspense and error boundaries, form actions, data fetching, and state management decisions. It is meant for writing or reviewing React components, with an accessibility-first approach to composition.

How do I install the react-patterns skill?

Run npx -y skills add affaan-m/ecc --skill react-patterns -y in your project to install it. Once installed, the agent can follow React 18 and 19 patterns when it writes or reviews React function components, custom hooks, and JSX or TSX files.

Does react-patterns cover Next.js App Router and React Server Components?

Yes, the skill covers working with Server Components and Client Components, including the App Router in Next.js. It explains where to place the use client boundary and how Server Actions connect to React 19 form actions.

When should an agent use react-patterns?

Use it when writing or modifying React function components, custom hooks, or component trees, or when reviewing JSX and TSX files. It also applies when choosing between local state, context, and external stores, or when migrating older forwardRef and useEffect-heavy code.

More from affaan-m/ecc

All 257

Similar to React Patterns

More Frontend & UI Code