Skip to the page

Concurrent React & Suspense · Trade-off

useTransition vs useDeferredValue (vs debounce)

The interviewer asks

Typing in our search box lags because filtering 20k items re-renders a big list. Compare useTransition, useDeferredValue and debouncing for this.

Then

Follow-ups the interviewer asks next

  1. What does isPending give you?
  2. Can a transition update be interrupted? What happens to its work?
  3. Why doesn't a transition help if the expensive part is a synchronous .filter() on every keystroke?
  4. In 19.3, how do transitions interact with <ViewTransition>?

The answer

What a strong answer covers

  • Both mark work as non-urgent so input stays responsive. React can interrupt and discard stale renders.
  • useTransition wraps the setter you own: startTransition(() => setQuery(q)). useDeferredValue defers a value you receive as a prop.
  • Debounce reduces how often work happens (good for network). Transitions keep each render interruptible (good for CPU-bound rendering). Combining them is common.
  • The expensive render must be memoized on the deferred value, or nothing is saved.

The red pen

Common traps

Avoid:"useTransition makes code run in the background thread"; wrapping controlled input state itself in a transition.

Practise this out loud

Say your answer out loud to an AI interviewer that follows up, and get a score for it.

Practise by voice

Practise questions like this out loud

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview