Optimize React Application Performance
Optimize your React application to achieve excellent Core Web Vitals metrics through advanced memoization and code splitting techniques.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Tu es un expert en performance frontend spécialisé dans React et l'optimisation des Core Web Vitals. Mon application React souffre de problèmes de performance que je dois résoudre.
Métriques actuelles :
- LCP (Largest Contentful Paint) : [EX: 4.2s, objectif < 2.5s]
- FID/INP (Interaction to Next Paint) : [EX: 320ms, objectif < 200ms]
- CLS (Cumulative Layout Shift) : [EX: 0.25, objectif < 0.1]
- Taille du bundle JS : [EX: 2.3MB non compressé]
Stack technique :
- React [VERSION] avec [EX: Next.js 14, Vite, Create React App]
- Gestion d'état : [EX: Redux Toolkit, Zustand, Context API]
- Composant ou page problématique : [DESCRIPTION]
Code du composant problématique :
[COLLER_LE_COMPOSANT_REACT]
Analyse et optimise en couvrant :
- Re-renders inutiles : identifie les causes et applique React.memo, useMemo, useCallback avec justification pour chaque usage.
- Code splitting : identifie les opportunités de lazy loading avec React.lazy et Suspense.
- Optimisation des images : formats modernes (WebP, AVIF), lazy loading natif, dimensions explicites.
- Virtualisation : si des listes longues sont présentes, implémente react-virtual ou react-window.
- Bundle analysis : identifie les dépendances lourdes et propose des alternatives légères.
- Métriques après optimisation : estime l'amélioration attendue pour chaque métrique Core Web Vitals.
Personalize this prompt with Léa
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
Why this prompt works
<p>This prompt integrates Core Web Vitals metrics as a starting point because they provide measurable objectives and correspond to Google's ranking criteria. This data-driven approach ensures optimizations are prioritized based on their actual impact on user experience.</p><p>Requesting justification for each use of React.memo, useMemo, and useCallback is crucial: these optimizations are often misapplied and can even degrade performance if used incorrectly. Contextual explanation prevents the frequent misuse by intermediate React developers.</p><p>Estimating expected gains for each optimization transforms the analysis into a prioritized action plan, allowing efforts to focus on high-impact changes before tackling micro-optimizations.</p>
Use Cases
Expected Output
A React performance issue analysis with optimized code, optimization explanations, and estimated Core Web Vitals gains.
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
- LéaAI
Pour une analyse précise, utilisez React Profiler pour identifier les re-renders coûteux avant d’appliquer useMemo ou React.memo. Cela évite les optimisations prématurées qui complexifient le code.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
Implement CSP with nonces
Prevent XSS with strict CSP
Plan a monolith-to-microservices migration
Migrate monoliths incrementally
Create a High-Performance Scalable Redis Cache System
A complete prompt to design and implement a Redis cache system with invalidation strategies, error handling and monitoring.
Prompt to Create Optimized Serverless Functions
A complete prompt to design production-ready serverless functions on Vercel or AWS Lambda, covering code, security, performance and deployment.