react-performance

Applies React and Next.js performance rules to eliminate waterfalls, re-renders, and bundle bloat.

3|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/waki285/dotfiles --skill react-performance-waki285
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: react-performance
Source: https://github.com/waki285/dotfiles/tree/main/.skills/react-performance
Command: npx skills add https://github.com/waki285/dotfiles --skill react-performance-waki285

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React and Next.js code often ships with hidden performance problems: async waterfalls blocking pages, broken memoization, duplicate RSC serialization, and bloated bundles. This Skill provides curated, non-obvious performance rules that AI assistants and developers commonly get wrong when writing or reviewing React code. ## Core Features & Use Cases - Async & Data Fetching Optimization: Eliminate waterfalls with Suspense boundaries, defer awaits to the branches that need them, and use React.cache() correctly with primitive arguments. - RSC & Server Component Guidance: Avoid duplicate serialization from array transforms, authenticate inside Server Actions, and use Next.js after() for non-blocking side effects. - Re-render & Bundle Reduction: Derive state during render instead of useEffect, keep memo() effective with stable defaults, and shrink bundles via direct imports and intent-based preloading. - Use Case: When reviewing a Next.js page that loads slowly, apply these rules to move data fetching into Suspense-wrapped child components, fix cache-missing React.cache() calls, and replace barrel imports with optimizePackageImports. ## Quick Start Review my React component and Next.js page for performance issues using the react-performance rules and suggest concrete fixes.

Frequently Asked Questions about react-performance

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

FAQPage Schema
How do I fix async waterfalls in Next.js pages?▼

Move data fetching into child async components wrapped in Suspense boundaries so the layout renders immediately while data streams in. Also defer await calls to the branch that actually needs the data instead of awaiting unconditionally at the top of a function.

Why does React.cache() always miss with object arguments?▼

React.cache() compares arguments with Object.is, so inline object literals create new references on every call and always miss. Pass primitives like numbers or strings as arguments instead of objects to get cache hits.

When should I not use useMemo in React?▼

Skip useMemo for trivial expressions like a + b, since the memoization overhead costs more than recomputing. Reserve it for genuinely expensive computations, and avoid inline default values for non-primitive props that break memo() by creating new references each render.

Why does my Next.js app send duplicate data in RSC payloads?▼

RSC deduplicates by object reference, so array transforms like .toSorted(), .filter(), or spread copies create new references that get serialized twice. Pass the original array to the client and transform it there with useMemo instead.

How do I reduce bundle size from icon libraries in Next.js?▼

Import from source files directly instead of barrel re-exports, for example importing the specific icon path from lucide-react. Alternatively, configure experimental.optimizePackageImports in next.config.js for Next.js 13.5 and later.

Why does {count && <List />} render a 0 on screen?▼

When count is 0, the && operator returns 0 itself, which React renders as text. Use a ternary like count > 0 ? <List /> : null so the falsy branch renders nothing.