react-performance

Diagnose and optimize React rendering, bundle size, memory usage, and Core Web Vitals.

3|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill react-performance-trudyan141
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-performance
Source: https://github.com/trudyan141/my-antigravity-agents-kit/tree/main/templates/.agent/skills/react-performance
Command: npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill react-performance-trudyan141

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React applications often suffer from slow renders, bloated bundles, memory leaks, and poor Core Web Vitals scores that degrade user experience. This Skill provides a systematic, profile-first methodology to identify bottlenecks and apply targeted optimizations. ## Core Features & Use Cases - Render Optimization: Diagnose excessive re-renders with React DevTools Profiler and fix them using React.memo, useCallback, useMemo, and context splitting. - Bundle & Code Splitting: Analyze bundle size with webpack-bundle-analyzer and implement route-based and component-level lazy loading with React.lazy and Suspense. - Memory & Virtualization: Detect memory leaks from missing useEffect cleanup and virtualize large lists with react-window. - Use Case: Your dashboard page takes 4 seconds to load and typing in the search box feels laggy. Use this Skill to profile the renders, apply useTransition for the search filtering, split the route bundle, and verify LCP drops below 2.5 seconds. ## Quick Start Ask the agent to profile your React app and fix the slow renders and large bundle size using the react-performance skill.

Frequently Asked Questions about react-performance

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

FAQPage Schema
How do I fix unnecessary re-renders in React components?

Use React DevTools Profiler to identify components rendering too often, then wrap them in React.memo and stabilize props with useCallback and useMemo. Removing inline objects and arrow functions from JSX props is the highest-impact first fix.

How to reduce React bundle size with code splitting?

Implement route-based code splitting using React.lazy and Suspense so each page loads on demand. Analyze the output with webpack-bundle-analyzer, replace heavy dependencies like moment or full lodash imports, and verify tree-shaking works correctly.

When should I use useTransition vs useDeferredValue in React 18?

Use useTransition when you control the state update, such as wrapping an expensive search filter in startTransition. Use useDeferredValue when you receive a value from a parent or prop and want to defer expensive re-renders derived from it.

Why does my React app memory usage keep growing over time?

Memory growth usually comes from missing useEffect cleanup: event listeners never removed, intervals never cleared, or fetch requests not aborted. Add cleanup functions that call removeEventListener, clearInterval, and AbortController.abort when components unmount.

How do I render large lists in React without lag?

Use virtualization with react-window so only visible rows mount in the DOM. FixedSizeList works for uniform row heights, while VariableSizeList handles dynamic content, keeping scroll performance smooth even with thousands of items.

What are good Core Web Vitals targets for a React app?

Target LCP under 2.5 seconds, FID under 100 milliseconds, and CLS under 0.1. Measure them with the web-vitals library and Lighthouse, then optimize with image prioritization, explicit dimensions to prevent layout shift, and bundle reduction.