Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
mastra-ai avatar

React Best Practices

  • 1.9k installs
  • 26.9k repo stars
  • Updated August 5, 2026
  • mastra-ai/mastra

A set of 14 performance optimization rules for React applications, organized by impact priority and applicable category.

About

Priority-ordered React performance guidelines covering 14 rules across 7 categories: waterfall elimination, bundle size optimization, client-side data fetching, re-render optimization, rendering performance, JavaScript micro-optimizations, and component structure. Developers apply these when writing new components, implementing data fetching, reviewing code for performance issues, or refactoring existing React code. Critical patterns include Promise.all() for parallel async operations, direct imports to avoid barrel files, Tanstack Query for request deduplication, lazy state initialization, startTransition for non-urgent updates, and single-responsibility component design. Rules prioritized by impact from CRITICAL to MEDIUM-HIGH to guide automated refactoring.

  • 14 rules prioritized by impact across 7 categories (waterfall elimination, bundle optimization, data fetching, re-render
  • Eliminate waterfalls with Promise.all() for independent async operations to reduce CRITICAL-impact bottlenecks
  • Reduce bundle size by avoiding barrel file imports and deferring non-critical third-party libraries
  • Apply Tanstack Query for automatic request deduplication and lazy state initialization for expensive computed values
  • Use startTransition for non-urgent updates, content-visibility: auto for long lists, and split bloated components into s

React Best Practices by the numbers

  • 1,874 all-time installs (skills.sh)
  • +90 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #257 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

react-best-practices capabilities & compatibility

Capabilities
identify async waterfall patterns · optimize bundle size via import strategies · detect unnecessary re renders · recommend tanstack query for data fetching · guide component splitting and single responsibil · advise on rendering performance (svg animation,
Use cases
code review · refactoring · frontend
From the docs

What react-best-practices says it does

Comprehensive performance optimization guide for React applications, containing 14 rules across 7 categories. Rules are prioritized by impact to guide automated refactoring and code generation.
react-best-practices.md#overview
npx skills add https://github.com/mastra-ai/mastra --skill react-best-practices

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.9k
repo stars26.9k
Security audit3 / 3 scanners passed
Last updatedAugust 5, 2026
Repositorymastra-ai/mastra

What it does

Optimize React component performance, bundle size, and data fetching patterns during development and code review.

Who is it for?

Writing new React components, implementing data fetching, reviewing code for performance issues, refactoring existing React code, optimizing bundle size or load times

Skip if: Non-React frontend frameworks, backend optimization, design system creation, non-performance-critical prototypes

When should I use this skill?

Writing React components, implementing data fetching, reviewing React code for performance, refactoring React code, optimizing bundle size or load times

What you get

Developers apply priority-ordered guidelines to eliminate performance bottlenecks, reduce bundle size, optimize data fetching, and improve component maintainability.

  • Performance-compliant React component code
  • Refactored components without waterfall patterns

By the numbers

  • 14 total optimization rules across 7 categories
  • 7 priority levels from CRITICAL to LOW-MEDIUM impact
  • 3 critical pattern categories: waterfall elimination, bundle optimization, component structure

Files

SKILL.mdMarkdownGitHub ↗

React Best Practices

Overview

Comprehensive performance optimization guide for React applications, containing 14 rules across 7 categories. Rules are prioritized by impact to guide automated refactoring and code generation.

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:

PriorityCategoryImpact
1Eliminating WaterfallsCRITICAL
2Bundle Size OptimizationCRITICAL
3Client-Side Data FetchingMEDIUM-HIGH
4Re-render OptimizationMEDIUM
5Rendering PerformanceMEDIUM
6JavaScript PerformanceLOW-MEDIUM
7Component StructureMEDIUM-HIGH (maintainability)

Quick Reference

Critical Patterns (Apply First)

Eliminate Waterfalls:

  • Use Promise.all() for independent async operations (async-parallel)

Reduce Bundle Size:

  • Avoid barrel file imports, import directly from source (bundle-barrel-imports)
  • Defer non-critical third-party libraries (bundle-defer-third-party)

Medium-Impact Patterns

Client-Side Data Fetching:

  • Use Tanstack Query for automatic request deduplication (client-request-dedupe)

Re-render Optimization:

  • Use lazy state initialization for expensive values (rerender-lazy-state-init)
  • Apply startTransition for non-urgent updates (rerender-transitions)
  • Minimize useEffect function calls (rerender-useeffect-function-calls)
  • Never reset state with useEffect; lift the discriminant and remount the branch (rerender-no-useeffect-state-reset)

Component Structure:

  • One domain component/hook per file, one responsibility each — split bloated components (structure-single-responsibility)

Rendering Patterns

  • Animate SVG wrappers, not SVG elements directly (rendering-animate-svg-wrapper)
  • Use content-visibility: auto for long lists (rendering-content-visibility)

JavaScript Patterns

  • Use Set/Map for repeated lookups (js-set-map-lookups)
  • Use toSorted() instead of sort() for immutability (js-tosorted-immutable)
  • Early length check for array comparisons (js-length-check-first)

References

Full documentation with code examples is available in:

  • references/react-best-practices-reference.md - Complete guide with all patterns
  • references/rules/ - Individual rule files organized by category

To look up a specific pattern, grep the rules directory:

grep -l "Promise.all" references/rules/
grep -l "barrel" references/rules/
grep -l "Tanstack" references/rules/

Rule Categories in references/rules/

  • async-* - Waterfall elimination (1 rule)
  • bundle-* - Bundle size optimization (2 rules)
  • client-* - Client-side data fetching (1 rule)
  • rerender-* - Re-render optimization (4 rules)
  • rendering-* - DOM rendering performance (2 rules)
  • js-* - JavaScript micro-optimizations (3 rules)
  • structure-* - Component/hook structure (1 rule)

Related skills

How it compares

Pick react-best-practices over generic React lint skills when AI agents need impact-ranked performance rules with concrete anti-pattern examples, not just style enforcement.

FAQ

What is the highest-priority React performance issue to fix?

Eliminating async waterfalls (Promise.all for independent operations) and reducing bundle size via direct imports instead of barrel files are CRITICAL priority.

When should I apply these guidelines?

Apply when writing new React components, reviewing code for performance issues, refactoring existing React code, or optimizing bundle size and load times.

How are these rules organized?

14 rules across 7 categories prioritized by impact: waterfalls (CRITICAL), bundle optimization (CRITICAL), client-side data fetching (MEDIUM-HIGH), re-renders (MEDIUM), rendering (MEDIUM), JavaScript performance (LOW-MEDIUM), component structure (MEDIUM-HIGH for maintainability).

Is React Best Practices safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Frontend Developmentfrontendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.