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
Analyze and Optimize Algorithmic Complexity
Analyze the Big O complexity of your algorithms and optimize them with appropriate data structures and more efficient algorithms.
Kubernetes Backup Strategy
Kubernetes Disaster Recovery Plan
Implement Clean Architecture in Practice
Implement Clean Architecture in practice with layers, ports and adapters, use cases, and unit tests without infrastructure.
AI-Assisted Complete Code Review
A complete prompt to get an in-depth code review covering bugs, security, performance, readability, and best practices, with concrete fixes.