react-best-practices

Apply performance guidelines to React and Next.js codebases.

130|8|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/sandgardenhq/sgai --skill react-best-practices-sandgardenhq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-best-practices
Source: https://github.com/sandgardenhq/sgai/tree/main/cmd/sgai/skel/.sgai/skills/react-best-practices
Command: npx skills add https://github.com/sandgardenhq/sgai --skill react-best-practices-sandgardenhq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill tackles slow load times, large bundle sizes, and inefficient rendering in React and Next.js applications by providing a structured set of performance‑focused guidelines.

Core Features & Use Cases

  • Eliminating async waterfalls: Optimize data fetching with parallelism and early promise start.
  • Bundle size reduction: Avoid barrel imports, apply dynamic imports, and defer non‑critical libraries.
  • Server‑side efficiency: Authenticate server actions, use caching (React.cache and LRU), and minimize serialization.
  • Client‑side data handling: Deduplicate event listeners, use passive scroll listeners, and manage localStorage wisely.
  • Render & re‑render tuning: Apply memoization, transition APIs, and SVG/content‑visibility tricks.
  • Real‑world scenario: When refactoring a Next.js page that suffers from long Time‑to‑Interactive, applying these rules yields faster first paint and lower CPU usage.

Quick Start

Use the react‑best‑practices skill to refactor a Next.js component for faster load time and reduced bundle size.

Frequently Asked Questions about react-best-practices

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

FAQPage Schema
How do I reduce bundle size and eliminate async waterfalls in Next.js?

To reduce bundle size and eliminate async waterfalls in Next.js, apply parallel data fetching, avoid barrel imports, and utilize dynamic imports to defer loading non-critical libraries.

What's the best way to optimize server-side rendering efficiency in React?

Optimize React server-side rendering efficiency by authenticating server actions, utilizing React.cache and LRU caching strategies, and minimizing data serialization overhead.

How do I prevent unnecessary re-renders and tune React component performance?

Tune React component performance and prevent unnecessary re-renders by applying memoization, using transition APIs, and implementing SVG and content-visibility rendering tricks.

How can I optimize client-side data handling for slow React applications?

Optimize client-side data handling in slow React applications by deduplicating event listeners, applying passive scroll listeners, and managing localStorage access efficiently.

Does this React performance optimization approach work when refactoring existing codebases?

Yes, these React performance optimization rules apply directly when writing, reviewing, or refactoring existing codebases, yielding faster first paint and lower CPU usage.

Why does my React application suffer from long Time-to-Interactive and how do I fix it?

Long Time-to-Interactive in React applications often stems from large bundle sizes and inefficient rendering, which you fix by applying structured performance guidelines like caching and parallel fetching.