Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

React Pro

ASecurity

Write professional React: hooks discipline, composition, performance, error boundaries, and modern patterns. Use for any React development beyond basics.

2 stars
0 votes
0 copies
0 views
Added 9/29/2026
ai-agentsgoreactnextjsnodeapiperformance

Works with

cliapi

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add aicodedecode/awesome-muse-skills --skill react-pro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of React Pro?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for React Pro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aicodedecode-react-pro/badge)](https://www.skillsdirectory.com/skills/aicodedecode-react-pro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: react-pro
description: Write professional React: hooks discipline, composition, performance, error boundaries, and modern patterns. Use for any React development beyond basics.
category: web-development
---

# React Pro

A practical guide to professional React: hooks used correctly, composition over configuration, performance without premature optimization, error boundaries, and the modern patterns (Server Components awareness, concurrent features) that define current React.

## Overview

React expertise is mostly **discipline**: effects that do one thing, state colocated with its use, components composed rather than configured, and renders kept cheap. The library's surface is small; the failure modes come from fighting its model — mutating state, effects as event handlers, and prop-drilling what should be composed.

## When to use

- Any React development: components, hooks, state architecture.
- Performance triage: unnecessary renders, slow interactions.
- Code review: spotting effect misuse, state duplication, composition failures.
- Modernizing class components or legacy patterns.

## Core concepts

- **Hooks rules.** Only at top level, only in components/hooks. `useState` for UI state; `useRef` for mutable non-render values (timers, DOM nodes, latest callbacks); `useMemo`/`useCallback` for expensive computations and stable references passed to memoized children.
- **Effects are for synchronization.** `useEffect` syncs with external systems (subscriptions, DOM measurements, network subscriptions) — not for "when X changes, update Y" (that's derived state: compute during render) and not for user events (that's an event handler).
- **Derived state.** If it can be computed from props/state, don't store it: `const total = items.reduce(...)` during render. `useMemo` only if expensive.
- **Composition.** `children`, slots (`header`/`footer` props), and compound components beat prop-configured mega-components (`<Modal title footerLeft ...>`).
- **Keys.** Stable, unique keys for lists — never index when order changes. Keys are identity: changing a key remounts.
- **Error boundaries.** Class components (or libraries) catching render errors per subtree — one crashing widget shouldn't kill the page.
- **Concurrent features.** `useTransition`/`startTransition` for non-urgent updates (filtering large lists), `useDeferredValue` for deferred rendering, `<Suspense>` for async boundaries.
- **Server Components awareness.** Even outside Next.js, the direction is clear: less client JS, server-rendered data, client components as interactive islands.

## Practical workflow

**1. Component shape.**
```tsx
function UserCard({ user, onSelect }: Props) {
  const [expanded, setExpanded] = useState(false);       // local UI state, colocated
  const fullName = `${user.first} ${user.last}`;          // derived, computed in render
  const handleSelect = () => onSelect(user.id);           // event handler, not effect

  useEffect(() => {                                       // external sync only
    const sub = presence.subscribe(user.id, setOnline);
    return () => sub.unsubscribe();
  }, [user.id]);

  return (...);
}
```

**2. Effect checklist.** Before writing `useEffect`, ask: is this responding to a user event (→ handler), computing render data (→ derive), or syncing with something outside React (→ effect)? Two of three aren't effects.

**3. Performance pass.** React DevTools Profiler → find wasted renders → fix causes (unstable props, context churn, missing memo) rather than wrapping everything in `memo`. `memo` is a bandage; stable data flow is the cure.

**4. State placement.** Lift only as high as needed. Global only when truly global. Prefer composition (passing components) over prop drilling.

**5. Async.** `use` hook / Suspense for data where supported; otherwise a data library (TanStack Query) — not hand-rolled effect fetching.

## Common pitfalls

- **Effects for derived state.** `useEffect(() => setFullName(a + b), [a, b])` — extra render, sync bugs. Compute during render.
- **Effects for events.** Fetching in an effect on mount for a button click flow — use the event handler.
- **Missing effect deps.** The exhaustive-deps warning is usually right. Suppressing it hides stale-closure bugs; restructure instead (move logic inside, use refs for latest values).
- **Stale closures.** Async callbacks capturing old state. Fix with functional updates (`setCount(c => c + 1)`), refs, or re-subscribing correctly.
- **Index keys.** Reordering/filtering with index keys scrambles component state. Stable IDs.
- **Prop drilling.** Five levels of pass-through props = compose instead (children/slots) or use context/store for truly shared state.
- **Context for high-frequency state.** Context re-renders all consumers on any change — fine for theme/locale, terrible for rapidly-changing values. Use a store with selectors.
- **`useMemo`/`useCallback` everywhere.** Memoization has cost; apply where profiling shows waste (expensive computes, memoized children receiving callbacks).
- **No error boundaries.** One throwing component unmounts the whole tree. Boundaries per feature area; log to error tracking in `componentDidCatch`.
- **Mutating state.** `state.items.push(x)` then `setState(state)` — same reference, no render. Always new references (or Immer).

Attribution

aicodedecodeaicodedecode
View sourceSee grades on GitHubMore from aicodedecode →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →