React Rendering Performance Fix
Fix unnecessary re-renders and optimize React component performance
My React app has rendering performance issues. Help me fix them. **Symptoms:** [DESCRIBE — e.g., "list feels janky when scrolling", "typing in search field is laggy", "entire page re-renders on every state change"] **Component code:** ``` [PASTE_PROBLEMATIC_COMPONENT_AND_PARENT] ``` Analyze and fix: 1. **Identify unnecessary re-renders** — which components re-render when they shouldn't 2. **Fix with the right tool:** - React.memo() — when and where (not everywhere) - useMemo() — for expensive computations - useCallback() — for callback props passed to memoized children - Key prop optimization — proper key usage in lists 3. **State management fixes:** - Move state closer to where it's used - Split large context into focused contexts - Use state selectors if using a store 4. **Virtualization** — if rendering long lists, add react-window or virtualization 5. **Event handling** — debounce/throttle expensive handlers For each fix: - Show the before and after code - Explain which renders it eliminates - Note any trade-offs (memory vs speed) Reminder: don't prematurely optimize. Only suggest changes that address the actual symptoms described.
How to Use This Prompt
- 1Copy the prompt template above
- 2Paste into Claude, ChatGPT, or Cursor
- 3Replace [bracketed placeholders] with your specific project details
- 4Iterate on the AI output to refine and customize the results
More Performance Prompts
Related performance templates from the vault
React Memo Optimization Audit
Use this prompt to react memo optimization audit with AI assistance
Server Response Time Optimizer
Use this prompt to server response time optimizer with AI assistance
Next.js Performance Optimization
Optimize a Next.js application for Core Web Vitals and loading speed
Core Web Vitals Performance Sprint
Run a focused performance sprint to bring all Core Web Vitals into the green zone with measurable before/after improvements
You Might Also Like
Prompts from other categories that share similar tags
React Server Component Data Pattern
Implement efficient data fetching patterns with React Server Components
Performance Bottleneck Finder
Identify and fix performance issues in slow code
SQL Query Optimizer
Optimize slow SQL queries with explain analysis
Infinite Scroll with Virtualization
Use this prompt to infinite scroll with virtualization with AI assistance
Keep Exploring the Vault