react-patterns

Standardize React component design, hooks, state, and testing patterns.

2|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/miptah21/skills --skill react-patterns-miptah21
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-patterns
Source: https://github.com/miptah21/skills/tree/main/.agents/skills/react-patterns
Command: npx skills add https://github.com/miptah21/skills --skill react-patterns-miptah21

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It reduces inconsistent React codebases by giving production-ready component, hooks, state, performance, and testing patterns that help you avoid common anti-patterns.

Core Features & Use Cases

  • Component Design Principles: Choose server/client/presentational/container patterns and follow clear rules like single responsibility and composition over inheritance.
  • Hook & State Management Guidance: Extract reusable hooks, keep hook order stable, and select the right state approach (local, context, server state via React Query/SWR, or global stores like Zustand/Redux Toolkit).
  • React 19 + TypeScript Best Practices: Apply modern React 19 hooks and compiler benefits while typing props, events, refs, and children safely.
  • Performance, Error Handling, and Testing: Profile first, use virtualization and memoization appropriately, structure error boundaries and recovery, and prioritize unit/integration/E2E tests by user impact.

Quick Start

Use the react-patterns skill to review your React component and refactor it to follow hook rules, lift state appropriately, and improve performance with targeted optimizations.

Frequently Asked Questions about react-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure React components to avoid common anti-patterns?

Structure React components by applying single responsibility, choosing server, client, presentational, or container patterns, and prioritizing composition over inheritance to build cleaner, production-ready apps.

What is the best way to manage state in React with hooks and TypeScript?

Manage state by selecting the right approach for your needs—local state, context, server state via React Query or SWR, or global stores like Zustand or Redux Toolkit—while keeping hook order stable and extracting reusable custom hooks.

How do I optimize React performance and handle errors effectively?

Optimize React performance by profiling first, then applying virtualization and memoization appropriately, while structuring error boundaries and recovery behaviors to handle runtime errors gracefully.

Does this approach support React 19 patterns and TypeScript typing?

Yes, the approach fully supports React 19 patterns, leveraging modern hooks and compiler benefits alongside safe TypeScript typing for props, events, refs, and children across common UI and data-fetching scenarios.

How do I prioritize tests for React components and hooks?

Prioritize your React tests by user impact, structuring a mix of unit, integration, and end-to-end tests to ensure deterministic hook behavior and validate component responsibilities effectively.