vercel-react-best-practices

Guide Next.js 16+ and React 19 development with Server Components and performance optimizations.

1|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/sathidpong01/magga --skill vercel-react-best-practices-sathidpong01
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/sathidpong01/magga/tree/main/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/sathidpong01/magga --skill vercel-react-best-practices-sathidpong01

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides essential guidelines and best practices for developing high-performance, production-ready applications using Next.js 16+ and React 19, focusing on modern patterns and optimizations.

Core Features & Use Cases

  • Next.js 16 Core Patterns: Master async APIs, data caching, and Server Actions.
  • React 19 Primitives: Leverage use(), useOptimistic, and useActionState for enhanced UI and data handling.
  • Performance Optimization: Implement strategies for server-side and client-side speed, bundle size reduction, and efficient rendering.
  • Use Case: A developer building a new Next.js application can use this Skill to ensure they are following the latest architectural patterns, leading to faster load times, better user experience, and more maintainable code.

Quick Start

Apply the advanced-event-handler-refs rule to store event handlers in refs for stable subscriptions.

Frequently Asked Questions about vercel-react-best-practices

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

FAQPage Schema
How do I use React 19 Server Components and Streaming in Next.js 16?

To use React 19 Server Components and Streaming in Next.js 16, leverage modern architectural patterns like async request APIs and data caching. This approach ensures faster server-side rendering and more maintainable production-grade applications.

What is the best way to handle data fetching and caching in Next.js 16?

The best way to handle data fetching and caching in Next.js 16 is by using core patterns like async request APIs and the unstable_cache function. These methods optimize server-side performance and streamline data management for React apps.

How do I implement optimistic UI with useOptimistic in React 19?

Implement optimistic UI in React 19 by using the useOptimistic primitive to immediately reflect expected state changes before server confirmation. Combine this with useActionState for handling Server Actions to enhance data handling and user experience.

Can I unwrap promises directly in React 19 components?

Yes, you can unwrap promises directly in React 19 components by using the use() primitive. This allows you to access resolved values within your components, streamlining asynchronous data handling without manual effect hooks.

Do I need to store event handlers in refs for stable subscriptions in React?

You need to store event handlers in refs using the advanced-event-handler-refs rule to maintain stable subscriptions. This prevents unnecessary re-renders and listener reattachments, optimizing client-side rendering performance.

What are the limitations of using unstable_cache for data caching?

While unstable_cache optimizes server-side data fetching in Next.js 16, its API may change in future releases. Monitor performance optimizations carefully as you implement this strategy for bundle size reduction and efficient rendering.