For images below the initial viewport, add loading="lazy" to React’s regular <img> element. Keep the likely Largest Contentful Paint (LCP) image eager so the browser can discover and load it promptly. Add known dimensions to reserve layout space, then verify the result in the browser rather than assuming it improved performance.
Use the native loading hint for offscreen images
React passes the HTML image loading hint through its <img> component. Set loading="lazy" on an image that is not needed when the page first opens:
<img
src="/images/article-detail.jpg"
alt="Description of the image"
width={1200}
height={800}
loading="eager"
/>
The browser can defer fetching the offscreen image until it approaches the viewport. This is a hint to the browser, not a precise fetch schedule that React controls. The dimensions let the browser reserve space before the image arrives. See React’s <img> reference.
Keep the likely LCP image eager
Do not apply lazy loading indiscriminately. An image visible immediately—particularly the likely LCP image—should generally remain eager. Delaying it can postpone its discovery and loading, undermining the page’s initial rendering. Leave the loading prop off that image unless measurements on the actual page support another choice. web.dev’s browser-level image lazy-loading guidance explains why initially visible images should not be deferred.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstall#1 Best Overall
This distinction matters with server-rendered React too: React says an image is automatically preloaded by default, while loading="lazy" prevents that automatic preload. If an image should load immediately but at low priority, React documents fetchPriority="low" as a separate option; it is not a substitute for lazy loading an offscreen image. See React’s preload reference.
Add dimensions and responsive sources
When the image’s intrinsic dimensions are known, provide width and height. The browser can then reserve its space while it loads, reducing unexpected layout shifts. For responsive assets, use srcSet and sizes to let the browser select a suitable source; those attributes select the resource, while loading influences when it is requested. React documents these props in its image reference.
<img
src="/images/guide-800.jpg"
srcSet="/images/guide-400.jpg 400w, /images/guide-800.jpg 800w, /images/guide-1200.jpg 1200w"
sizes="(max-width: 600px) 100vw, 800px"
alt="A guide image"
width={1200}
height={800}
loading="eager"
/>
Lazy loading changes request timing, not file weight. If images still transfer too many bytes, optimize dimensions, formats, and compression separately. MDN’s fast-loading HTML guidance treats image optimization as a distinct part of page performance.
Prefer native loading unless you need custom visibility behavior
For ordinary images lower on a page, start with the native attribute. Browser-level lazy loading avoids the extra JavaScript and implementation decisions of a custom loader. MDN describes the loading attribute as deferring offscreen resources until the user scrolls near them; MDN’s lazy-loading guide and web.dev cover the native approach.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #3
Use Intersection Observer when the experience needs custom behavior, such as a specific visibility threshold or a placeholder transition. It observes when an element enters or leaves the viewport, but a custom loader also means you must handle when to assign the image source, placeholders, failed loads, and support for your target browsers. MDN describes the API in its lazy-loading guide. The cited guidance does not establish a need for a third-party library for a typical React page.
Do not confuse image loading with React.lazy(). React’s lazy API defers loading a component’s code until the component is rendered; the HTML image loading="lazy" hint defers an image request. See React’s lazy reference.
Rank #4
Validate the change on your page
- Inspect the first viewport. Check representative mobile and desktop sizes and identify which image is visible immediately and likely to be the LCP image.
- Choose loading behavior by visibility. Keep the likely LCP image eager; set
loading="lazy"on images below the initial viewport. - Preserve layout and responsive selection. Add known width and height values and retain appropriate
srcSetandsizesattributes. - Inspect rendered markup and network activity. Confirm the visible image starts promptly and offscreen images are deferred as expected.
- Compare performance consistently. Use the same test conditions before and after. The effect depends on the actual page; do not claim a speedup without measuring it.
Common problems and fixes
- The hero image appears late: it may have been marked lazy even though it is initially visible. Remove
loading="lazy"from that image and verify its request starts promptly. - An image appears to load immediately despite the hint: native loading is browser-managed. Check the rendered
<img>, its position at the tested viewport, and the network panel; the hint does not define an exact distance or timing. - The page jumps when an image arrives: provide its known
widthandheightso space can be reserved in advance. - A responsive image downloads an unsuitable file: review the
srcSetcandidates andsizesvalue. These control source selection, not lazy-loading timing. - No image should render yet: avoid passing an empty string as
src. React warns against it; omit the element or usenullwhen there is no image to render. - A framework image component behaves differently: check its documentation and inspect the resulting HTML. Framework components may set lazy loading by default or expose an explicit preload option.
- The page remains heavy after adding lazy loading: lazy loading defers requests but does not compress files. Optimize image dimensions, formats, and compression independently.
Or skip the browser setup
If you need screenshots of pages to review how images behave, ScreenshotNeo can return a page screenshot or PDF. Here is a one-request example; see the API documentation for the available options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
- Cookie and consent banners, newsletter popups, and chat widgets are removed before capture; each step can be turned off.
- Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed. The response includes
X-Page-VerdictandX-Billedheaders. - An MCP server provides
take_screenshot,get_page_info, andcapture_pdftools for AI agents and MCP clients. - The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Yearly billing gives two months free, and every feature is available on every plan.
Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.
Free tools Windows power users keep installed
One-click scans. No signup required.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

