Skip to content
Back to skills

React Development

ASecurity

Use when implementing or reviewing React components, hooks, state ownership, forms, rendering performance, error boundaries, or component tests. Use nextjs-app-router for Next.js server boundaries and ux-content-strategy for product content systems.

  • 28 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 28, 2026
developmenttypescriptgoreactnextjstestingapifullstackperformance

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned October 1, 2026

npx -y skills add peterbamuhigire/skills-web-dev --skill react-development --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of React Development?

Add the live security badge to your README. It updates with every re-scan.

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

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

Download with Pro
SKILL.md
---
name: react-development
description: Use when implementing or reviewing React components, hooks, state ownership, forms, rendering performance, error boundaries, or component tests. Use nextjs-app-router for Next.js server boundaries and ux-content-strategy for product content systems.
metadata:
  portable: true
  compatible_with:
  - claude-code
  - codex
---

# react-development
Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com, +256 784 464178.

<!-- dual-compat-start -->
## Use When

- Comprehensive React patterns and best practices: functional components, all hooks (useState, useEffect, useCallback, useMemo, useRef, useContext, useReducer), custom hooks, state management (local/Context/external), performance optimisation...

## Evidence Produced

| Category | Artifact | Format | Example |
|----------|----------|--------|---------|
| Correctness | Component test plan | Markdown doc covering hook, context, and rendering tests | `docs/web/react-component-tests.md` |

## References

- Use the `references/` directory for deep detail after reading the core workflow below.
<!-- dual-compat-end -->
Production-grade React patterns drawn from Mastering React (Horton & Vice), Pro React (Antonio), and modern React 18/19 best practices.

## Quick Reference

| Topic | Reference |
|---|---|
| All hooks with examples | `references/hooks.md` |
| Custom hooks library | `references/custom-hooks.md` |
| State management patterns | `references/state-management.md` |
| Performance optimisation | `references/performance.md` |
| TypeScript + React | `references/typescript.md` |
| TS + React production gotchas (Fullstack React with TS) | `references/react-typescript-gotchas.md` |
| Testing (RTL) | `references/testing.md` |
| Forms and validation | `references/forms.md` |
| React 18/19 features; load for 19.2/19.3 APIs and React Compiler adoption | `references/react-18-19.md` |
| Large-scale React + TS app architecture (layers, HTTP/API client, config, i18n, primitives) | `../../languages/typescript-full-stack/references/large-scale-react-ts.md` |

---

## 1. Component Architecture

### Functional Components — Canonical Form

```jsx
function UserCard({ name, email, onSelect }) {
  return (
    <div className="user-card" onClick={() => onSelect(email)}>
      <h3>{name}</h3>
      <p>{email}</p>
    </div>
  );
}
```

Always use function declarations for named components. Arrow functions for callbacks only.

### Composition — Parent Owns State

Build from small autonomous pieces. Parent owns state; children receive props and call
callback props to signal events upward (unidirectional data flow).

```jsx
function KanbanBoard() {
  const [cards, setCards] = useState([]);

  const addCard  = (card) => setCards(prev => [...prev, card]);
  const updateCard = (id, data) =>
    setCards(prev => prev.map(c => c.id === id ? { ...c, ...data } : c));

  return (
    <div className="board">
      {cards.map(card => (
        <KanbanCard key={card.id} card={card} onUpdate={(d) => updateCard(card.id, d)} />
      ))}
      <AddCardForm onAdd={addCard} />
    </div>
  );
}
```

### props.children and Slot Pattern

```jsx
function Card({ title, children, footer }) {
  return (
    <div className="card">
      <h2>{title}</h2>
      <div className="card__body">{children}</div>
      {footer && <div className="card__footer">{footer}</div>}
    </div>
  );
}
// <Card title="Summary" footer={<button>Save</button>}><p>Content</p></Card>
```

### Container / Presentational Split

```jsx
// Presentational — pure UI, all data via props
function TaskList({ tasks, onToggle }) {
  return (
    <ul>
      {tasks.map(t => (
        <li key={t.id} className={t.done ? 'done' : ''} onClick={() => onToggle(t.id)}>
          {t.name}
        </li>
      ))}
    </ul>
  );
}

// Container — fetches data, manages state, delegates rendering
function TaskListContainer() {
  const [tasks, setTasks] = useState([]);
  useEffect(() => { fetchTasks().then(setTasks); }, []);
  const toggle = (id) =>
    setTasks(prev => prev.map(t => t.id === id ? { ...t, done: !t.done } : t));
  return <TaskList tasks={tasks} onToggle={toggle} />;
}
```

---

## Additional Guidance

Extended guidance for `react-development` was moved to [references/skill-deep-dive.md](references/skill-deep-dive.md) to keep this entrypoint compact and fast to load.

Use that deep dive for:
- `2. Core Hooks — Quick Reference`
- `3. Custom Hooks`
- `4. State Management`
- `5. Performance Optimisation`
- `6. Forms`
- `7. Error Boundaries`
- `8. React 18 / 19 Concurrent Features`
- `9. Testing`
- `10. Anti-Patterns Checklist`
- `11. Architecture Checklist`

## Decision rules

| Condition | Choice | Failure avoided |
|---|---|---|
| State is used by one component | Keep it local | Premature global state |
| State is shared by a tight subtree | Lift it or use focused context | Global-store coupling |
| Value is derived from props or state | Compute during render | Synchronisation effects |

## Anti-Patterns

- Mirroring derived values in state. Fix: compute them during render.
- Using an effect for user-triggered logic. Fix: use the event handler.
- Mutating state arrays or objects. Fix: create a new value through the setter.
- Keying changing lists by array index. Fix: use a stable domain identifier.
- Adding context for state used by one component. Fix: keep ownership local.

## Capability contract

Read and search the component tree and tests first. Edit only when authorised; execute type-checks, component tests, accessibility checks, and the production build when available.

## Degraded mode

If the repository or test runner is unavailable, return a component-level plan and mark rendering, accessibility, and regression behaviour as unverified.
## Inputs
| Artefact | Required? | Purpose |
|---|---|---|
| Component behaviour, state/data boundaries, accessibility, and project conventions | yes | Shape React implementation |
## Outputs
- Produce React code or findings with state coverage, accessibility, tests, and performance evidence.

Files in this skill

  • SKILL.md6.1 KB
  • references/custom-hooks.md7.6 KB
  • references/forms.md6.3 KB
  • references/hooks.md9 KB
  • references/performance.md6.9 KB
  • references/react-18-19.md8.4 KB
  • references/react-patterns/entrypoint.md13.7 KB
  • references/react-typescript-gotchas.md7.1 KB
  • references/routing.md175 B
  • references/skill-deep-dive.md11 KB
  • references/state-management.md8 KB
  • references/testing.md7.6 KB
  • references/typescript.md7.8 KB

Attribution

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

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.