react-performance-optimization

Optimizes React applications using memoization, code splitting, virtualization, and profiling techniques.

Updated Aug 3, 2026
One-click install
npx skills add https://github.com/Yvesdefaria/GymLab --skill react-performance-optimization-yvesdefaria
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-performance-optimization
Source: https://github.com/Yvesdefaria/GymLab/tree/main/gymlab-app/.agents/skills/react-performance-optimization
Command: npx skills add https://github.com/Yvesdefaria/GymLab --skill react-performance-optimization-yvesdefaria

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires react-window, and includes references (resource) components.

What problem does it solve? React applications often suffer from unnecessary re-renders, bloated bundles, and sluggish large lists that degrade user experience. This Skill provides structured guidance to diagnose and fix these performance bottlenecks using proven React patterns. ## Core Features & Use Cases - Memoization Patterns: Apply React.memo, useMemo, and useCallback correctly to eliminate wasted renders without over-optimizing. - Code Splitting & Bundle Optimization: Implement React.lazy, Suspense, and tree-shakeable imports to shrink initial load times. - List Virtualization: Render thousands of rows smoothly with react-window by mounting only visible items. - Use Case: Your dashboard with 10,000 table rows freezes on scroll. Use this Skill to virtualize the list, memoize row components, and split heavy chart components into lazy-loaded chunks. ## Quick Start Ask the AI to profile and optimize the slow-rendering components in your React application using memoization and code splitting.

Frequently Asked Questions about react-performance-optimization

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

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

Wrap expensive components in React.memo and pass stable references using useCallback for functions and useMemo for objects. First profile with React DevTools Profiler to confirm which components actually re-render unnecessarily before optimizing.

How to reduce React bundle size with code splitting?

Use React.lazy with Suspense to split route components and heavy dependencies like charts or editors into separate chunks. Analyze the bundle with webpack-bundle-analyzer or rollup-plugin-visualizer, and import only specific lodash functions instead of the whole library.

react-window vs react-virtualized for large lists?

react-window is lighter at 7KB gzipped with a simpler API, making it the recommended choice for most lists. react-virtualized at 27KB offers advanced components like Grid and Masonry for complex layouts, while @tanstack/react-virtual provides a headless option for custom implementations.

When should I use useMemo and useCallback in React?

Use useMemo only for genuinely expensive computations like filtering or sorting large arrays, and useCallback when passing functions to memoized child components. Memoizing simple components or trivial calculations adds comparison overhead without benefit.

Why does my React context cause every component to re-render?

A single context holding all state forces every consumer to re-render when any value changes. Split contexts by update frequency, such as separate UserContext, ThemeContext, and DataContext, so components only subscribe to the state they actually use.

What is the difference between useTransition and useDeferredValue?

useTransition lets you mark specific state updates as non-urgent by wrapping them in startTransition, while useDeferredValue defers a value itself and lets React decide when to re-render. Both keep inputs responsive during expensive updates like search filtering in React 18.