Concurrent React & Suspense · Trade-off
useTransition vs useDeferredValue (vs debounce)
Practise this out loud
Say your answer out loud to an AI interviewer that follows up, and get a score for it.
Practise by voiceThe 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
- What does
isPendinggive you? - Can a transition update be interrupted? What happens to its work?
- Why doesn't a transition help if the expensive part is a synchronous
.filter()on every keystroke? - 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.
useTransitionwraps the setter you own:startTransition(() => setQuery(q)).useDeferredValuedefers 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 voicePractise 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.