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.
Provides expert guidance for optimizing React performance through memoization, code splitting, and virtualization. Use when profiling reveals slow components, large lists need virtualization, or bundle size reduction is required.
/plugin marketplace add NickCrew/claude-ctx-plugin/plugin install nickcrew-claude-ctx@NickCrew/claude-ctx-pluginThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/code-splitting.mdreferences/common-pitfalls.mdreferences/concurrent-features.mdreferences/memoization.mdreferences/profiling-debugging.mdreferences/state-management.mdreferences/virtualization.mdExpert guidance for optimizing React application performance through memoization, code splitting, virtualization, and efficient rendering strategies.
React re-renders components when props or state change. Unnecessary re-renders waste CPU cycles and degrade user experience. Key optimization techniques:
Load detailed patterns and examples as needed:
| Topic | Reference File |
|---|---|
| React.memo, useMemo, useCallback patterns | skills/react-performance-optimization/references/memoization.md |
| Code splitting with lazy/Suspense, bundle optimization | skills/react-performance-optimization/references/code-splitting.md |
| Virtualization for large lists (react-window) | skills/react-performance-optimization/references/virtualization.md |
| State management strategies, context splitting | skills/react-performance-optimization/references/state-management.md |
| useTransition, useDeferredValue (React 18+) | skills/react-performance-optimization/references/concurrent-features.md |
| React DevTools Profiler, performance monitoring | skills/react-performance-optimization/references/profiling-debugging.md |
| Common pitfalls and anti-patterns | skills/react-performance-optimization/references/common-pitfalls.md |
# Open React DevTools Profiler
# Record interaction → Analyze flame graph → Find slow components
Look for:
For unnecessary re-renders:
React.memouseCallback for stable function referencesFor expensive computations:
useMemo to cache resultsFor large lists:
For slow initial load:
React.lazy# Record new Profiler session
# Compare before/after metrics
# Ensure optimization actually helped
import { memo } from 'react';
const ExpensiveList = memo(({ items, onItemClick }) => {
return items.map(item => (
<Item key={item.id} data={item} onClick={onItemClick} />
));
});
import { useMemo } from 'react';
function DataTable({ items, filters }) {
const filteredItems = useMemo(() => {
return items.filter(item => filters.includes(item.category));
}, [items, filters]);
return <Table data={filteredItems} />;
}
import { useCallback } from 'react';
function Parent() {
const handleClick = useCallback((id) => {
console.log('Clicked:', id);
}, []);
return <MemoizedChild onClick={handleClick} />;
}
import { lazy, Suspense } from 'react';
const Dashboard = lazy(() => import('./Dashboard'));
const Reports = lazy(() => import('./Reports'));
function App() {
return (
<Suspense fallback={<Loading />}>
<Routes>
<Route path="/" element={<Dashboard />} />
<Route path="/reports" element={<Reports />} />
</Routes>
</Suspense>
);
}
import { FixedSizeList } from 'react-window';
function VirtualList({ items }) {
return (
<FixedSizeList
height={600}
itemCount={items.length}
itemSize={80}
width="100%"
>
{({ index, style }) => (
<div style={style}>{items[index].name}</div>
)}
</FixedSizeList>
);
}
config={{ theme: 'dark' }})Before optimizing:
Optimization targets:
After optimizing:
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.