INP measures how long the page takes to show a visible response after a user interaction. Most poor INP scores come from long JavaScript tasks, heavy hydration, third-party scripts or handlers that do too much work on the main thread.
Key takeaways
- Target: INP ≤ 200ms at the 75th percentile.
- Measure field data before choosing a fix.
- Change one bottleneck at a time and re-measure on a mid-range phone.
- A fast lab score is not a substitute for real-user data.
What Interaction to Next Paint measures
The browser records the latency from an interaction (click, tap or key press) to the next paint. The reported INP is the high percentile of interactions across the page, not just the slowest one.
The fixes that usually move the number
- Break long tasks into smaller chunks and yield to the browser between them.
- Move non-urgent work out of the click handler: analytics, logging, network calls that can wait.
- Reduce client-side JavaScript and hydration on interactive routes.
- Defer third-party scripts and audit tag manager triggers.
- Use React transitions for non-blocking state updates where the UI can wait.
Symptom, cause and fix
| Symptom | Likely cause | What to do |
|---|---|---|
| Click does nothing for a second | A long task blocks the main thread | Split the task, defer work, show immediate feedback |
| Typing lags in a search box | Filtering a large list on every keystroke | Debounce, use a transition, virtualise results |
| Menu opens slowly | Heavy component hydration | Render on the server or load the component on demand |
| Only on mobile | Slower CPU and more scripts | Test on a mid-range device with CPU throttling |
How to measure it properly
- Find the worst interactions. Use the Performance panel or a Real User Monitoring tool that captures INP attribution.
- Record a trace. Click the slow control while recording and inspect long tasks and script time.
- Profile the handler. Look for synchronous loops, large JSON parsing or layout thrashing.
- Test on a mid-range phone. Do not rely on a desktop browser with a fast CPU.
- Re-measure after the fix. Compare the same interaction and check for regressions elsewhere.
A practical example
import { startTransition, useDeferredValue } from "react";
const [query, setQuery] = useState("");
const deferredQuery = useDeferredValue(query);
function onChange(event) {
const value = event.target.value;
setQuery(value);
startTransition(() => {
// Non-urgent filtering can wait for the browser.
updateResults(deferredQuery);
});
}
Common mistakes
- Assuming a fast desktop score means mobile interactions are fine.
- Adding analytics or error logging synchronously in every click handler.
- Hydrating the whole page for one small interactive widget.
- Using
useMemoeverywhere instead of reducing the work being done.
A 30-day improvement plan
- Week 1. Collect field data and pick the worst route. Write down the baseline.
- Week 2. Fix the largest bottleneck and deploy behind a normal release.
- Week 3. Test on a mid-range phone and a throttled connection; fix regressions.
- Week 4. Compare field data, document the change and add a monitor or budget.
Field data vs lab data
| Source | What it tells you | How to use it |
|---|---|---|
| Field data | What real users experienced | The source of truth for the metric |
| Lab test | A reproducible diagnosis | Find the cause and test a fix |
| Synthetic monitoring | Availability and regressions over time | Alert on a budget breach |
| RUM segmentation | Device, country and route differences | Target the worst segment |
| Server timing | Database, cache and render time | Separate backend from frontend |
Set a performance budget
| Budget | Example starting point | Why |
|---|---|---|
| LCP | 2.5s or less at p75 | The main content must appear quickly |
| INP | 200ms or less at p75 | Interactions must feel responsive |
| CLS | 0.1 or less at p75 | Layout movement erodes trust |
| JavaScript | A route-level KB budget | Prevents bundle creep |
| Images | Responsive sizes and modern formats | The largest common payload |
| Third-party scripts | A named owner and a cap | Uncontrolled tags are a common regression |
Third-party script policy
- Every script needs an owner, a purpose and a review date.
- Load analytics and marketing tags after consent and after the main content.
- Prefer server-side events where they reduce client JavaScript.
- Test the checkout and sign-up with the full tag set enabled.
- Remove tags that no longer answer a business question.
Frequently asked questions
The target is INP ≤ 200ms at the 75th percentile. A single fast test is not enough; use the 75th percentile of real page views and segment by mobile and desktop.
No. Start with the routes that matter to revenue or support: checkout, pricing, sign-up, the main product page and the most-read blog template. A fast homepage with a slow checkout is not a fast site.
It depends on traffic. Low-traffic sites can take weeks to accumulate enough data. Use lab tools for immediate feedback, but keep the field metric as the source of truth.
Often yes. Image dimensions, priority, bundle splits, caching and third-party scripts usually deliver more than a visual refresh. Redesign only after the measurement shows the layout itself is the bottleneck.
Sources and further reading
- Optimise Interaction to Next Paint (web.dev)
- Web Vitals (web.dev)
- React documentation (react.dev)
Related reading
Need a performance audit?
Send the URL and the metric that matters. I will identify the bottleneck, the likely fix and the cheapest way to prove it worked.
How to cite this guide: Nur Hossain Repon, “INP optimization guide for Next.js and React apps”, Nhrepon Portfolio, reviewed October 2026, https://nhrepon.com/posts/inp-optimization-guide-for-next-js-and-react-apps.





Comments
No comments yet.