Skip to the page

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.

The 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 adds useDeferredValue(value, initialValue).
  • The expensive child must be memoized on the deferred value (memo or 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 startTransition can be async (an Action). State updates after an await currently need another startTransition around 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

  1. Typing in our search lags because filtering 20k items re-renders a big list. Compare useTransition, useDeferredValue and debouncing.
  2. What does isPending give you?
  3. Can a transition update be interrupted? What happens to its work?
  4. Why does a transition not help if the expensive part is synchronous code in the event handler?
  5. How do transitions relate to Suspense fallbacks and <ViewTransition>?

Practise

Practise with these questions

Your first interview is free

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

Start your free interview