React Best Practices

React and Next.js performance optimization guidelines from Vercel Engineering. Use when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns.

Category: Development

About this skill

Comprehensive performance optimization guide for React and Next.js applications, containing 40+ rules across 8 categories. Rules are prioritized by impact to guide automated refactoring and code generation. Reference these guidelines when writing new React components or Next.js pages, implementing data fetching, reviewing code for performance issues, refactoring existing React/Next.js code, or optimizing bundle size or load times.

Source and installation instructions

Installation

  1. Copy the skill instructions to your AI agent's context or rules file

Documentation

Vercel React Best Practices

Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Contains 70 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Eliminating WaterfallsCRITICALasync-
2Bundle Size OptimizationCRITICALbundle-
3Server-Side PerformanceHIGHserver-
4Client-Side Data FetchingMEDIUM-HIGHclient-
5Re-render OptimizationMEDIUMrerender-
6Rendering PerformanceMEDIUMrendering-
7JavaScript PerformanceLOW-MEDIUMjs-
8Advanced PatternsLOWadvanced-

Quick Reference

1. Eliminating Waterfalls (CRITICAL)

2. Bundle Size Optimization (CRITICAL)

3. Server-Side Performance (HIGH)

4. Client-Side Data Fetching (MEDIUM-HIGH)

5. Re-render Optimization (MEDIUM)

6. Rendering Performance (MEDIUM)

7. JavaScript Performance (LOW-MEDIUM)

8. Advanced Patterns (LOW)

How to Use

Read individual rule files for detailed explanations and code examples:

rules/async-parallel.md
rules/bundle-barrel-imports.md

Each rule file contains:

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md