facebook page view

Fix Slow React Interactions With INP

Fix Slow React Interactions With INP

If a React interface feels sluggish when users type, filter, open a menu, or switch tabs, measure Interaction to Next Paint (INP) with real-user data, reproduce the slow action, and identify whether JavaScript, rendering, or other main-thread work delays the next visible frame. The right fix is usually to reduce unnecessary work, break up long tasks, and make expensive rendering interruptible—not to add random delays or blindly memoize every component.

Google’s Core Web Vitals cover loading (Largest Contentful Paint, LCP), responsiveness (INP), and visual stability (Cumulative Layout Shift, CLS). A good INP target is 200 milliseconds or less at the 75th percentile; above 500 milliseconds is poor. Measure mobile and desktop separately because field experiences can differ.

What INP reveals about a React app

INP observes qualifying interactions across a visit and reports a value representing responsiveness. A slow interaction can involve delay before event handlers start, time spent processing the event, and delay before the browser presents the next frame. React may contribute to processing or rendering cost, but browser work, third-party scripts, layout, and application code can all be involved.

A page can load quickly and still feel broken afterward. A product list, for example, may render promptly but freeze when a shopper changes a filter because the app recalculates thousands of items and updates a large DOM tree on every click. INP focuses debugging on what users experience after the initial load.

Step 1: Find the slow interaction

Start with field data. Use PageSpeed Insights to inspect available Chrome User Experience Report data and Search Console’s Core Web Vitals report to identify affected pages. Where possible, use real-user monitoring that records the interaction, route, device class, and timing breakdown. Field data shows what users experience; a lab recording helps explain why.

Do not assume one Lighthouse run represents every visit. If the problem appears only after opening a menu or applying a filter, reproduce that precise action rather than repeatedly testing the initial load.

Step 2: Profile the action in DevTools

Record the interaction in the browser’s Performance panel. Look for long JavaScript tasks, repeated component rendering, expensive style calculations, layout, and third-party scripts. Compare a normal action with a slow one and note what changed: row count, DOM size, network response, or work inside the event handler.

Use the timing breakdown to choose the fix. High input delay suggests the main thread was busy before the handler started. High processing time points toward expensive handlers or computation. High presentation delay suggests too much DOM, layout, or rendering work before the next frame.

Step 3: Keep handlers small and rendering limited

Avoid large filtering, sorting, parsing, or transformation jobs directly inside a click or input handler. Update the minimum state needed to respond immediately, then move non-urgent work out of the critical interaction path. Cache derived results when inputs have not changed, and avoid recalculating the same data in multiple components.

For large datasets, consider server-side filtering, pagination, list virtualization, or a Web Worker for CPU-heavy calculations. A worker can move suitable computation off the main thread, but DOM updates still happen on the main thread and transferring large objects can add overhead. Measure before choosing an architecture.

Step 4: Prioritize React rendering without delaying input

React provides useDeferredValue and useTransition to keep urgent updates responsive while less urgent rendering happens in the background. These features do not make expensive work disappear, but they let React prioritize immediate input over a costly results view.

For example, a search box can update its controlled input immediately while passing a deferred query to an expensive results component:

const [query, setQuery] = useState('');

const deferredQuery = useDeferredValue(query);

 

return (

  <>

    <input value={query} onChange={event => setQuery(event.target.value)} />

    <SearchResults query={deferredQuery} />

  </>

);

The results component may need memoization so it can skip rendering when the deferred value has not changed. useDeferredValue defers rendering; it does not automatically debounce network requests. React’s documentation also warns against using a Transition for the state that controls a text input, because that update needs to remain synchronous.

Use useTransition for non-urgent updates such as switching a complex view. Show pending feedback where useful, and do not treat hooks as a substitute for profiling a component that performs excessive work on every render.

Step 5: Break up long tasks and audit third-party code

A task that monopolizes the main thread can delay input and visual updates. Split independent work into smaller chunks and yield between them where appropriate. web.dev recommends doing less work in user-facing functions and yielding to the main thread rather than relying on one technique for every app.

Third-party analytics, chat widgets, ads, and tag managers can also compete for the main thread. Compare performance with and without them in a controlled test, load nonessential code later, and remove integrations that no longer serve a clear purpose. Keep required functionality; identify its specific cost before changing it.

Step 6: Verify the fix with the same user journey

Repeat the original interaction on a representative device and compare the timing breakdown. Then monitor field data after deployment. A local improvement is useful evidence, but it does not prove every user will see the same result.

Google says Core Web Vitals are used by its ranking systems, but they are not a single ranking signal and good scores do not guarantee top rankings. Treat INP work as a user-experience improvement, not a shortcut to search visibility.

Common Mistakes

  • Optimizing only initial load: A page can load quickly but become unresponsive during filtering, typing, or navigation.

  • Memoizing everything: Memoization helps only when it prevents meaningful repeated work; profile first.

  • Deferring the controlled input: Keep input state synchronous and defer expensive results rendering instead.

  • Trusting one lab score: Pair repeatable tests with field data and retest the exact interaction that was slow.

Expert Tips

  • Test on mid-range mobile hardware: Desktop devices can hide long tasks users notice on slower phones.

  • Separate measurement from diagnosis: Use field data to find the affected interaction, then profile its cause.

  • Set budgets for key actions: Track search, filtering, navigation, and checkout—not only page-load metrics.

  • Recheck after release: Third-party scripts, data volume, and user behaviour can change over time.

Frequently Asked Questions

·      What is a good INP score?

A good INP is 200 milliseconds or less at the 75th percentile. Between 200 and 500 milliseconds needs improvement; above 500 milliseconds is poor.

·      Does React automatically make an app slow?

No. Performance depends on JavaScript, state updates, DOM size, rendering patterns, data processing, and third-party code. Profile the actual bottleneck.

·      Should I use useTransition for every slow interaction?

No. It helps prioritize non-urgent updates but cannot eliminate expensive computation or fix every main-thread bottleneck.

·      Does useDeferredValue reduce API requests?

Not by itself. It defers rendering of a value; it does not automatically debounce or cancel requests for each input change.

·      Do Core Web Vitals guarantee higher Google rankings?

No. Google uses Core Web Vitals in its ranking systems, but good scores do not guarantee top positions.

Conclusion

Fix slow React interactions with evidence. Find the affected action in field data, profile it in the browser, and reduce the work blocking the next frame. Keep input updates urgent, defer expensive rendering where appropriate, shrink large DOM updates, break up long tasks, and retest after deployment. INP improves when an app responds quickly to real actions—not when developers chase a score without understanding the cause.

 

Share this article
A
Written by
Alaffiya Madarwala
Last updated

15 October 2026

Comments

Book Your Free Demo Class

Experience our teaching style, interact with mentors, and see how we help you become job-ready.

No spam. Just one demo. Relax.


© 2026 Praxia Skill Pvt. Ltd. All rights reserved.