The browser has to download and run a React site's JavaScript before it can show the page, and a slow React site is sending too much of it. So most of the work is sending less script and getting real HTML into the first response. useMemo and React.memo, the tricks people reach for first, come last, because they do very little for load time.
The fixes, in the order to do them:
| Fix | What you get |
|---|---|
| Measure with PageSpeed Insights and a bundle analyser | No speed gain, but you stop guessing |
| Remove or replace heavy libraries | Less script to download and run |
| Import by name, one icon set | A smaller bundle with no visible change |
| Split code by route, lazy-load below the fold | The first page loads only what it needs |
| Server render or prerender | Content shows before scripts load. The largest LCP change for apps that render only in the browser |
| Responsive images, hero not lazy, sizes set | Faster LCP, less layout jump |
| Preload fonts | Text appears sooner |
| Cut or delay third-party tags | Less blocking time on mobile |
| Fix re-renders, virtualise long lists | Smoother typing and clicking. Little change to load time |
Stop when the numbers pass. I build React and Next.js sites for a living, and I did this clean-up on my own site, mohitgoyal.in, which runs on React 19 and TanStack Start.
How do I find out what's making my React site slow?
Run the page through PageSpeed Insights on mobile, then open a bundle analyser. Those two reports tell you where the time goes before anyone touches the code.
PageSpeed Insights gives you two kinds of numbers. The top part is field data from real Chrome users, if your site has enough traffic. The lower part is a Lighthouse lab test. A visitor on a budget Android phone on mobile data has a far slower device and connection than your MacBook on office Wi-Fi, so don't wave the mobile score away because the site feels fine at your desk.
Google's targets, from web.dev's Core Web Vitals page, are:
| Metric | What it measures | Good |
|---|---|---|
| LCP (Largest Contentful Paint) | How long the main image or heading takes to appear | Within 2.5 seconds |
| INP (Interaction to Next Paint) | How long the page takes to react to a tap or click | 200 milliseconds or less |
| CLS (Cumulative Layout Shift) | How much the page jumps around while loading | 0.1 or less |
web.dev says to measure these at the 75th percentile of page loads, separately for mobile and desktop. That means three out of four visits should hit the target.
The Lighthouse score points the same way. Chrome's Lighthouse scoring page gives Total Blocking Time 30% of the performance score and LCP 25%. Total Blocking Time is the time the browser is stuck running scripts and can't respond. So 55% of the score is tied to how much JavaScript you send and how soon the main content shows.
The score also changes from one run to the next, and people end up arguing about which run is right. Chrome's page says to think of it as a spread of scores, not a single number. Run the test three times and look at the metrics, not the badge.
The bundle analyser is the second report. A bundle is the JavaScript file your build tool produces, and the analyser draws it as a map of boxes, one per library, sized by weight. On Next.js that's @next/bundle-analyzer. On Vite it's rollup-plugin-visualizer. Ask your developer for a screenshot. You don't have to read code to spot one library taking a third of the picture.
Send less JavaScript
Heavy libraries
Open the analyser map and question the biggest boxes. The usual ones are an animation library, an icon pack, a date library, a charting library, and a rich text editor that only the admin screen uses.
On mohitgoyal.in, an animation library and an icon library came out of most pages. Parts of the site tilt when you hover, and the buttons pull slightly towards the cursor. Both effects used to come from the animation library. They now use CSS transforms driven by a few lines of script, with no animation library. The scroll animations were split into small components that load only on the pages that use them.
If a library exists on your site to make one button wiggle, delete it. A visitor on a Redmi phone gets a page that opens sooner, and nobody misses the library.
Imports
Tree shaking is the build step that drops code you never call. It only works if the code is imported by name. This is the difference, for your developer:
// Pulls in the whole library
import _ from "lodash";
// Pulls in one function
import debounce from "lodash/debounce";
Icons are the common trap. A project picks up a second and a third icon pack over the years, each added for a handful of icons. Settle on one icon set that tree-shakes, so only the icons on the page end up in the bundle.
Code splitting
Code splitting means the browser downloads the code for the page it's on, not for the whole site. Frameworks like Next.js and TanStack Start split by route for you. A plain React app made with Vite or the old Create React App does not, unless your developer sets it up.
For things below the fold (the part of the page you have to scroll to see), React has lazy. The React docs for lazy say React won't load the component's code until the first time you try to render it. Good candidates are maps, video players, chat windows, carousels and anything inside a popup. Have the developer give the placeholder a fixed height. If it has none, the page jumps when the real component arrives and your CLS gets worse.
Should a React site be server rendered?
A classic React app sends a nearly empty page and a big script, and the script builds the page in the browser. On a slow phone that's a white screen for seconds, and your LCP can't be good no matter what else you tune. It also hurts search, which I covered in my post on why a React website isn't ranking on Google.
Server rendering turns that around. The server sends finished HTML, so the visitor sees content before the JavaScript has loaded. For a public site that needs to load fast and rank, do it.
Prerendering is the cheaper version of the same idea. Pages are built into HTML once, at deploy time. For a marketing site, a blog or a catalogue that changes a few times a day, prerender. For pages that differ per visitor, server render.
This is the biggest single change in the table and also the most work, because it means moving to Next.js, TanStack Start or a similar framework. If the analyser shows a five-year-old Create React App build with libraries nobody remembers adding, a rebuild on one of those frameworks can be cheaper than patching. And if you're already on Next.js and still failing, the problem is elsewhere. My Next.js Core Web Vitals fix post walks through that case.
Images and fonts
On a marketing page the LCP element tends to be the hero image, so this is what moves LCP once the JavaScript is under control.
Serve each image at the size it's shown. mohitgoyal.in serves responsive image sizes, which means a phone gets a small file and a desktop gets a bigger one. It also preloads the two fonts the page uses, so text doesn't wait in a queue behind other files. Then check that the hero image is not lazy-loaded, that every image has a width and height set so the layout doesn't jump, and that images below the fold are lazy-loaded.
Formats and compression are in how to optimise website images without losing quality.
Tracking tags and chat widgets
Count them. Google Tag Manager, GA4, Meta Pixel, a heatmap tool, a WhatsApp chat bubble, a popup tool, and a payment script such as Razorpay's loaded on every page when only checkout needs it. Each tag is someone else's JavaScript running on your visitor's phone, and on marketing sites the tags are sometimes heavier than the site's own code.
Remove the ones nobody looks at. Load the chat bubble after the visitor scrolls or after a few seconds. Load payment scripts only on the pages that take payment.
The tags belong to marketing and the score belongs to the developer, so nobody owns the problem. Somebody has to. The Tag Manager side has its own post: is Google Tag Manager slowing down your website.
Re-renders, useMemo and React.memo
These make a loaded page respond faster, which helps INP. They do nothing for how long the page takes to appear, so a "React optimisation" quote that starts with memoisation on a site that's failing LCP has the order backwards.
A re-render is React redrawing part of the page. Memoisation is React remembering a result so it can skip that work. If typing in a search box or opening a filter feels sticky, look here. Use the Profiler in React DevTools to see which components redraw on each keystroke. And if you show a list of thousands of rows, use list virtualisation (a library such as TanStack Virtual or react-window), which draws only the rows on screen.
Before your developer hand-writes useMemo everywhere, look at React Compiler. The React Compiler docs describe it as a build-time tool that memoises components automatically, and say it is now stable. The same page says to leave existing manual memoisation in place, so it's not a reason to rip things out of old code.
For an app that lives behind a login, this section moves to the front. A dashboard or an internal tool that staff open once in the morning and use all day doesn't need server rendering or a perfect LCP. Its slow moments are re-renders, long lists and filters, so start there.



