react-patterns

Guide React development with modern patterns, hooks, and TypeScript practices.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/Andrejr82/Caculinha_BI --skill react-patterns-andrejr82
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-patterns
Source: https://github.com/Andrejr82/Caculinha_BI/tree/main/.agent/skills/react-patterns
Command: npx skills add https://github.com/Andrejr82/Caculinha_BI --skill react-patterns-andrejr82

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to modern React patterns and best practices, helping developers build robust, scalable, and performant applications.

Core Features & Use Cases

  • Component Design Principles: Understand different component types (Server, Client, Presentational, Container) and design rules for maintainability.
  • Hook Patterns: Learn when and how to extract custom hooks for reusable logic (e.g., useFetch, useForm).
  • State Management: Guidance on selecting the right state management solution (useState, Context, Zustand, Redux Toolkit) based on complexity.
  • React 19 Features: Overview of new hooks like useActionState and useOptimistic.
  • Performance Optimization: Strategies for identifying and addressing performance bottlenecks using profiling, memoization, and virtualization.
  • Error Handling: Implementing Error Boundaries for graceful failure and recovery.
  • TypeScript Best Practices: Effective typing for props, events, and refs.
  • Testing Strategies: Unit, integration, and E2E testing approaches.
  • Anti-Patterns: Common pitfalls to avoid in React development.

Quick Start

Explain the concept of Server Components in React 19.

Frequently Asked Questions about react-patterns

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

FAQPage Schema
How do I select the right state management solution for my React application?

Selecting React state management depends on complexity: use useState for local UI state, Context for shared data, Zustand for lightweight global state, and Redux Toolkit for robust, large-scale applications.

What are the new hooks in React 19 and how do I use them?

React 19 introduces hooks like useActionState for managing form submission states and useOptimistic for showing immediate UI updates before server confirmation, streamlining asynchronous user interactions.

When should I extract custom hooks in React?

Extract custom hooks in React when you need to reuse stateful logic across multiple components, such as data fetching with useFetch or form validation with useForm, to ensure maintainability.

What is the best way to optimize React performance and fix bottlenecks?

Optimize React performance by using profiling to identify bottlenecks, applying memoization to prevent unnecessary re-renders, and implementing virtualization for rendering large lists efficiently.

How do I type React props, events, and refs with TypeScript?

Type React elements in TypeScript by defining explicit interfaces for component props, using specific event types like React.ChangeEvent for handlers, and applying RefObject for ref typing.

What are common React anti-patterns to avoid in production applications?

Common React anti-patterns include prop drilling, overusing Context for high-frequency updates, and neglecting Error Boundaries, which degrades maintainability and causes ungraceful failures.