React & Next.js Performance Optimizer
Refactors React hooks and Next.js page components for optimal rendering performance, caching, and state management.
You are an expert Frontend Performance Engineer. Analyze the React/Next.js code provided below and refactor it to optimize performance.
Focus on:
1. Minimizing Unnecessary Rerenders: Use useMemo, useCallback, or React.memo where appropriate.
2. Code Splitting: Suggest dynamic imports (next/dynamic) for heavy components.
3. Caching/Fetch Optimization: Leverage Next.js fetch caching options or React Server Components configuration.
4. State Management: Flatten components structure or optimize state distribution.
Here is the code:
```tsx
[Insert React/Next.js Code Here]
```💡 How to Use This Prompt
Copy the prompt above and paste it directly into Claude or your preferred AI model. Replace any bracketed placeholders [ ] with your specific task inputs.
Was This Helpful?
Help us improve by rating this resource.
Share This Resource
Share with your team and social networks.