react-patterns

Provide React patterns for typed components, hooks, state, and performance.

58|5|Updated Mar 23, 2026
One-click install
npx skills add https://github.com/mukiwu/muki-ai-plugins --skill react-patterns-mukiwu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-patterns
Source: https://github.com/mukiwu/muki-ai-plugins/tree/main/plugins/shipshape-skills/skills/react-patterns
Command: npx skills add https://github.com/mukiwu/muki-ai-plugins --skill react-patterns-mukiwu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps React developers avoid common mistakes and adopt modern, maintainable patterns for building TypeScript React components, custom hooks, and performant UIs.

Core Features & Use Cases

  • Typed props & component patterns: clear guidance on interface definitions, default values, and safe callback typing for predictable APIs.
  • Composition & compound components: patterns for building modular, reusable UI primitives and context-backed compound components.
  • Custom hooks & data fetching: reusable hook examples with loading, error handling, and refetch semantics.
  • State management: recommendations for Context + useReducer and lightweight stores such as Zustand for predictable global state.
  • Performance optimization: practical use of useMemo, useCallback, React.memo, lazy loading, virtualization, and memoization strategies.
  • Forms, validation & error boundaries: strategies for controlled forms, validation (Zod suggested), and robust error handling.
  • Anti-patterns to avoid: common pitfalls like creating objects in render, missing effect dependencies, and mutable state updates with examples to fix them.

Quick Start

Review my React component and provide concrete refactors using hooks, typed props, proper state management, and performance 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 custom hooks for data fetching with proper loading and error handling?

React custom hooks for data fetching should encapsulate loading states, error handling, and refetch semantics. This Skill provides reusable hook examples that manage these states predictably within TypeScript React projects.

What's the best way to manage global state in React: Context useReducer or Zustand?

For global state management in React, Context with useReducer suits predictable state transitions, while Zustand offers a lightweight store alternative. This Skill outlines recommendations for implementing both approaches effectively.

How do I optimize React performance using memoization and lazy loading?

Optimize React performance by applying useMemo, useCallback, React.memo, lazy loading, and virtualization strategies. This Skill provides practical guidance on when and how to implement these memoization techniques.

Does this React patterns guidance cover TypeScript typed props and compound components?

Yes, this React patterns guidance covers TypeScript typed props, interface definitions, safe callback typing, and context-backed compound components. It applies directly to TypeScript React projects during component design.

Why should I avoid creating objects in render and missing effect dependencies in React?

Creating objects in render and missing effect dependencies are common React anti-patterns that cause unnecessary re-renders and stale data bugs. This Skill provides examples to identify and fix these mutable state pitfalls.

How do I handle controlled forms validation and error boundaries in React?

Handle controlled forms validation and error boundaries in React by using Zod for validation schemas and wrapping components with robust error boundaries. This Skill demonstrates strategies for implementing these patterns.