react-performance-optimization
React performance optimization patterns using memoization, code splitting, and efficient rendering strategies. Use when optimizing slow React applications, reducing bundle size, or improving user experience with large datasets.
Security Assessment
Detected risks:
About react-performance-optimization
react-performance-optimization gives expert guidance for making React applications faster through memoization, code splitting, virtualization, and efficient rendering strategies. It addresses the problem that React re-renders components whenever props or state change, and unnecessary re-renders waste CPU and degrade user experience. The skill applies when optimizing slow-rendering components, reducing bundle size for faster initial loads, improving responsiveness for large lists or data tables, preventing re-render cascades in complex trees, or debugging performance with the React DevTools Profiler.
It centers on a measurement-first workflow: profile with React DevTools to find real bottlenecks, apply targeted optimizations, then profile again to verify improvements and avoid premature optimization. Concrete patterns include wrapping components with React.memo, caching computed values with useMemo, stabilizing function references with useCallback, code-splitting routes with React.lazy and Suspense, and virtualizing large lists with react-window (FixedSizeList). It also covers React 18+ concurrent features (useTransition, useDeferredValue) and state structuring to minimize render cascades such as context splitting. Detailed patterns are split into reference files loaded as needed: memoization.md, code-splitting.md, virtualization.md, state-management.md, concurrent-features.md, profiling-debugging.md, and common-pitfalls.md, and the skill ships a validation/rubric.yaml. It enumerates common mistakes like over-memoization, inline objects/arrays breaking memoization, missing dependencies causing stale closures, using array index as a key, and a single large context.
Target users are React developers, especially those working in TypeScript (file patterns cover .ts and .tsx), tackling slow apps, large datasets, or heavy bundles. A performance checklist frames before, during, and after work: profile and measure a baseline, memoize expensive components and values, use useCallback for functions passed to memoized children, code-split routes and heavy components, virtualize lists over 100 items, use stable unique keys, split state by update frequency, then re-profile to confirm gains and check for regressions. Tools referenced include React DevTools, webpack-bundle-analyzer, rollup-plugin-visualizer, and Lighthouse.
FAQ
What is the recommended optimization workflow?
Profile first with React DevTools Profiler to identify actual bottlenecks, apply targeted optimizations (React.memo, useMemo, useCallback, code splitting, virtualization), then profile again to verify the change actually improved performance. The skill stresses avoiding premature optimization of already-fast components.
When should I virtualize a list?
The performance checklist recommends virtualizing lists with more than 100 items, using react-window (for example FixedSizeList), and ensuring stable unique keys (not array index).
What are the most common mistakes it warns about?
Over-memoizing simple fast components, passing inline objects/arrays that create new references and break memoization, missing dependencies causing stale closures, using array index as a key, relying on a single large context that triggers widespread re-renders, and optimizing without profiling.
Does it cover React 18 concurrent features?
Yes. It references useTransition and useDeferredValue for improving responsiveness (React 18+), with detailed patterns in references/concurrent-features.md.
How is the detailed guidance organized?
Core guidance is in SKILL.md, with deeper patterns loaded on demand from reference files including memoization.md, code-splitting.md, virtualization.md, state-management.md, concurrent-features.md, profiling-debugging.md, and common-pitfalls.md.
All Files
9 filesInstall react-performance-optimization
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
nickcrew/claude-ctx-plugin