react-patterns

Guide React 18+ TypeScript projects through component design, hooks, state, and performance patterns.

9|2|Updated Dec 5, 2025
One-click install
npx skills add https://github.com/Zate/cc-plugins --skill react-patterns-zate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-patterns
Source: https://github.com/Zate/cc-plugins/tree/main/plugins/devloop/skills/react-patterns
Command: npx skills add https://github.com/Zate/cc-plugins --skill react-patterns-zate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building maintainable and performant React applications requires adherence to modern patterns and best practices. Without clear guidance, projects can suffer from prop drilling, unnecessary re-renders, and complex state management.

Core Features & Use Cases

  • Component Design: Best practices for functional components, TypeScript interfaces, and effective component composition.
  • Hooks Mastery: Guidance on custom hooks for logic reuse, useEffect dependencies, and common hook usage (useState, useMemo, useCallback).
  • State Management: Implement robust state solutions using Context + Reducer patterns for complex application states.
  • Performance Optimization: Strategies like React.memo, virtualization for lists, and code splitting to keep your app fast.
  • Use Case: Design a new React component, optimize a slow-rendering list, implement a global theme, or ensure accessibility in your UI.

Quick Start

Create a custom React hook to fetch and manage user data, including loading and error states, with proper cleanup.

Frequently Asked Questions about react-patterns

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

FAQPage Schema
How do I avoid prop drilling and manage state effectively in React applications?

Use Context API combined with useReducer hooks to create centralized state management that eliminates prop drilling across component trees. This pattern provides a scalable alternative to passing props through multiple levels while maintaining strong TypeScript typings for type safety.

What are the best practices for writing React components with TypeScript?

Build functional components with explicit TypeScript interfaces for props, use hook-based patterns like useState and useEffect with proper dependency arrays, and apply React.memo for performance optimization. This approach ensures components are maintainable, type-safe, and performant across React 18+ projects.

How do I create custom React hooks for logic reuse and data fetching?

Extract component logic into custom hooks that handle data fetching, loading states, and error management with proper cleanup in useEffect. This pattern enables logic reuse across components while keeping concerns separated and maintaining TypeScript type safety.

Why are my React lists rendering slowly and how do I fix it?

Slow list rendering typically stems from unnecessary re-renders or large DOM trees. Optimize using React.memo for list items, virtualization techniques for large datasets, and code splitting. These performance strategies keep rendering fast without sacrificing accessibility or component structure.

Can I implement accessible React components with modern patterns?

Yes. Modern React patterns support accessibility through semantic HTML in component design, keyboard navigation in hooks, and ARIA attributes in TypeScript interfaces. Accessibility considerations integrate naturally into component design and state management workflows.

What's the difference between useState, useCallback, and useMemo in React hooks?

useState manages component state, useCallback memoizes functions to prevent unnecessary re-renders of child components, and useMemo caches computed values. Understanding when to use each hook is critical for optimizing performance and preventing prop drilling in React 18+ applications.