Concurrent React and Suspense · senior
Transitions and useDeferredValue
A transition marks a state update as non-urgent so React can keep the input responsive and interrupt, restart or drop that render; useTransition/startTransition wrap an update you own, and useDeferredValue gives a lagging copy of a value you receive.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
const [isPending, startTransition] = useTransition(); startTransition(() => setTab(next));. Urgent updates (typing, clicks) interrupt transition renders.- You cannot use a transition for the state that controls a text input; keep the input urgent and defer the expensive part.
const deferredQuery = useDeferredValue(query): React first renders with the old value, then re-renders in the background with the new one. Use it when you receive the value as a prop. React 19 addsuseDeferredValue(value, initialValue).- The expensive child must be memoized on the deferred value (
memoor the Compiler), or nothing is saved. - Transitions keep already-visible content on screen instead of showing a Suspense fallback again.
- React 19: the function passed to
startTransitioncan be async (an Action). State updates after anawaitcurrently need anotherstartTransitionaround them. - Debounce/throttle limit how often work starts (good for network calls); transitions make each render interruptible (good for CPU-heavy rendering). They combine well.
- React 19.3: transitions render independently instead of being entangled into one render, so a slow transition no longer blocks unrelated ones.
The red pen
Common traps: mistake → fix
Mistake: "useTransition runs code in a background thread"
Fix: same main thread; it only changes priority and lets React interrupt.
Mistake: "Wrap the input's own state in startTransition"
Fix: typing becomes laggy; React does not allow transitions to control text inputs.
Mistake: "useDeferredValue is a debounce"
Fix: it has no fixed delay; on fast devices the deferred render happens almost immediately.
Mistake: "A transition helps if the expensive part is a synchronous
.filter()in the input's handler"Fix: work outside rendering is not interruptible.
Easy to hard
Questions interviewers ask, easy to hard
- Typing in our search lags because filtering 20k items re-renders a big list. Compare useTransition, useDeferredValue and debouncing.
- What does
isPendinggive you? - Can a transition update be interrupted? What happens to its work?
- Why does a transition not help if the expensive part is synchronous code in the event handler?
- How do transitions relate to Suspense fallbacks and
<ViewTransition>?
Practise
Practise with these questions
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.