# react-patterns

Get guidance on React components, hooks, state choices, and performance. Useful when building or refactoring a React interface with TypeScript.

- skill · `type=skill` · Claude Code · 321 installs
- Author: davila7
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/development/react-patterns
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/react-patterns

## What it does

This skill covers component boundaries, reusable hooks, and where state belongs, from a component’s own `useState` to Context or an app-wide store. It also addresses React 19 hooks such as `useActionState` and `useOptimistic`, along with TypeScript prop and event-handler types.

For slow renders, the guidance is to inspect performance with DevTools and locate the bottleneck before changing code. Then choose a targeted measure, such as virtualizing a large list or using `useMemo` for expensive calculations. That means memoization is not treated as a default fix. Error boundaries and testing levels are covered too.

Install it with `npx claude-code-templates@latest --skill development/react-patterns`. The listed tools are `Read`, `Write`, `Edit`, `Glob`, and `Grep`.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --skill development/react-patterns
```

2. **Skills CLI (Vercel)**
```bash
npx skills add davila7/claude-code-templates --skill react-patterns -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/react-patterns/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/react-patterns/

### Codex

**Manually: put the files in place**
- File: `.agents/skills/react-patterns/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

**Manually: put the files in place**
- File: `.cursor/skills/react-patterns/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install davila7/claude-code-templates react-patterns
```

2. **Manually: put the files in place**
- File: `.github/skills/react-patterns/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/development/react-patterns
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/react-patterns/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/development/react-patterns

## When to use it
- split a large component into focused pieces
- choose where shared state should live
- extract repeated logic into a custom hook
- locate the cause of slow renders before optimizing
- type component props and event handlers in TypeScript

## Example prompts
- Review this large React component and suggest a clearer component and state structure.
- Find repeated logic here that should become a custom hook.
- Help me locate the bottleneck in this slow list and choose a suitable fix.

## Similar
- [frontend-design](https://affpapa.org/en/nevibecode/skills/frontend-design.md) — skill · 1025790 installs
- [design-taste-frontend](https://affpapa.org/en/nevibecode/skills/design-taste-frontend.md) — skill · 678700 installs
- [prototype](https://affpapa.org/en/nevibecode/skills/prototype.md) — skill · 986201 installs
- [hyperframes](https://affpapa.org/en/nevibecode/skills/heygen-com-hyperframes.md) — skill · 1200000 installs
- [hyperframes-cli](https://affpapa.org/en/nevibecode/skills/heygen-com-hyperframes-cli.md) — skill · 1300000 installs
- [webapp-testing](https://affpapa.org/en/nevibecode/skills/webapp-testing.md) — skill · 186758 installs

## Other versions with the same name
- [react-patterns · affaan-m](https://affpapa.org/en/nevibecode/skills/affaan-m-react-patterns.md) — 4900 installs
- [react-patterns · giuseppe-trisciuoglio](https://affpapa.org/en/nevibecode/skills/giuseppe-trisciuoglio-react-patterns.md) — 4800 installs
- [react-patterns · jezweb](https://affpapa.org/en/nevibecode/skills/jezweb-react-patterns.md) — 1300 installs
- [react-patterns · manutej](https://affpapa.org/en/nevibecode/skills/manutej-react-patterns.md) — 471 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 495 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
