Actionable guide to passing Google's Core Web Vitals in React. Learn how to diagnose INP bottlenecks, eliminate blocking JS, and reach 95+ scores.
Google explicitly uses Core Web Vitals as a search ranking factor. When potential customers visit your website and tap a button or open a navigation drawer, even a 300ms delay sends negative behavioral signals that damage both your conversion rate and your search visibility.
While building [Restaurant OS](/projects/4), our team had to ensure that waiters and chefs handling real-time order states experienced instant, 60fps tactile feedback even on budget mobile devices. Here is the exact performance playbook we used to achieve sub-100ms INP.
The most common culprit behind a red INP score is performing heavy state computations synchronously inside an event handler. Use React's `startTransition` API to prioritize immediate user visual feedback while deferring heavy background filtering or re-calculations.
import { useState, useTransition } from "react";
export function ProductCatalogSearch({ items, onSelect }) {
const [searchTerm, setSearchTerm] = useState("");
const [filteredItems, setFilteredItems] = useState(items);
const [isPending, startTransition] = useTransition();
const handleSearchChange = (e) => {
const query = e.target.value;
// 1. Immediate visual update for the input field
setSearchTerm(query);
// 2. Non-blocking deferred transition for 1000+ items
startTransition(() => {
const results = items.filter((item) =>
item.name.toLowerCase().includes(query.toLowerCase())
);
setFilteredItems(results);
});
};
return (
<div>
<input
type="text"
value={searchTerm}
onChange={handleSearchChange}
placeholder="Search inventory..."
className="px-4 py-2 bg-zinc-900 border border-white/10 rounded-xl"
/>
{isPending && <span className="text-xs text-cyan-400">Filtering...</span>}
{/* Product List */}
</div>
);
}LCP measures how long it takes for the largest visual element on the screen (usually a hero image or title banner) to become fully visible. To optimize LCP below 1.5s:
Is your website feeling sluggish or losing customers due to slow load times? [Get in touch with Aafaque Nazir](/contact) for a comprehensive frontend performance audit and speed optimization.
Interaction to Next Paint (INP) measures a page's overall responsiveness to user interactions (clicks, taps, keystrokes) across its entire lifecycle. A score under 200 milliseconds is classified as 'Good'. Sites failing INP receive reduced ranking priority in Google's mobile search results.
React single page applications frequently execute heavy JavaScript on user interactions—such as re-evaluating large component trees, complex JSON transformations, or triggering non-composited CSS layout calculations on the main UI thread.
In all client projects by Aafaque Nazir, assets are converted to modern WebP/AVIF formats, CSS is strictly purged with Tailwind CSS, third-party scripts are deferred, and heavy interactive components are code-split using React.lazy with Framer Motion DomAnimation.