New advertisers: 50% off your first month with code FIRSTMONTHSee slots
mastra-ai avatar

React Best Practices

Authoritative React performance guide routing 27 rules across nine prioritized categories for writing and reviewing components.

skills.sh installs
2.8K
GitHub stars
29.7K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers waterfall elimination, bundle size, data fetching, re-render, rendering, JavaScript, structure, testing, and type-safety rules
  • Lists critical patterns first, such as Promise.all() for independent async work and direct imports instead of barrel files
  • Enforces no as type assertions, undefined over null for absence, and no useMemo or useCallback without profiler evidence
  • Designed for reviewing and refactoring React code, with detailed rule files loaded on demand from references/rules/

Install

$ npx -y skills add mastra-ai/mastra --skill react-best-practices -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

React Best Practices

Overview

Routing and priority guide for React performance and quality, containing 27 rules across 9 categories. Rule files hold the detailed explanations, examples, review smells, and impact metrics.

When to Apply

Reference these guidelines when:

  • Writing new React components
  • Implementing data fetching
  • Reviewing code for performance issues
  • Refactoring existing React code
  • Optimizing bundle size or load times

Priority-Ordered Guidelines

Rules are prioritized by impact:

Details

Repository
github.com/mastra-ai/mastra
Categories
Frontend & UI Code, Code Review & Quality
First seen
May 16, 2026

More from mastra-ai/mastra

All 4

Similar to React Best Practices

More Frontend & UI Code