react-patterns

Provide React 19+ patterns for Server Components, hooks, and state management.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/ps-carvalho/spavn-agents --skill react-patterns-ps-carvalho
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-patterns
Source: https://github.com/ps-carvalho/spavn-agents/tree/main/.opencode/skills/react-patterns
Command: npx skills add https://github.com/ps-carvalho/spavn-agents --skill react-patterns-ps-carvalho

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and best practices for building robust, performant, and scalable React applications using the latest features and patterns.

Core Features & Use Cases

  • Modern React APIs: Learn to leverage Server Components, the use() hook, Actions, and useOptimistic for efficient data handling and rendering.
  • Architecture & State Management: Understand best practices for project structure, custom hooks, and choosing the right state management solution (Zustand, Jotai, etc.).
  • Performance Optimization: Implement techniques like memoization, virtualization, and lazy loading to ensure a smooth user experience.
  • Use Case: When starting a new React project or refactoring an existing one, use this Skill to ensure you're adopting modern patterns for better performance and maintainability.

Quick Start

Use the react-patterns skill to generate a new React component using Server Components and the use() hook.

Frequently Asked Questions about react-patterns

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

FAQPage Schema
What are React Server Components and how do they change frontend architecture?

React Server Components render exclusively on the server to reduce client bundle size and enable direct backend data fetching. They shift frontend architecture by minimizing client-side JavaScript execution and simplifying state management for data-heavy applications.

How do I use the use() hook and Actions for state management in React 19?

The use() hook reads promises and context within components, while Actions manage async form submissions and mutations. They integrate asynchronous data flows directly into the React component lifecycle, simplifying state management without external libraries.

What's the best way to optimize performance in a scalable React application?

Optimize React performance by implementing memoization, virtualization, and lazy loading to prevent unnecessary renders. Structure scalable applications with custom hooks and state management solutions like Zustand or Jotai to isolate re-renders and maintain efficiency.

Does this React 19 guide cover optimistic UI updates?

Yes, this React 19 guidance covers optimistic UI updates using the useOptimistic hook. It provides patterns to immediately update interfaces before server confirmation, ensuring smooth user experiences during asynchronous mutations and data submissions.

When should I choose Zustand or Jotai over native React state management?

Choose Zustand or Jotai for complex state management when native React hooks cause prop drilling or excessive re-renders. These libraries provide scalable global state isolation, whereas native state management remains sufficient for localized component data.