Home / Learn React / useTransition and useDeferredValue

useTransition and useDeferredValue

Some updates are urgent (typing in a box) and some can wait (filtering ten thousand rows). These hooks let you mark slow updates as non urgent so the page stays smooth.

In shortstartTransition marks a state update as low priority. useDeferredValue gives you a copy of a value that updates a little later.

Theory in plain words

Urgent first, slow laterUser typesUrgent: inputshows the letterTransition: listrenders in backgroundNew typing cancelsold background work
Urgent first, slow later

What it is

useTransition gives you [isPending, startTransition]. Updates wrapped in startTransition are "transitions": React can interrupt them if something more urgent happens. useDeferredValue(value) returns an older value first and the new one when React is free.

Why we use it

A slow render blocks the browser. If every keystroke triggers a heavy list render, typing feels laggy. Transitions let the input update at once while the heavy part catches up.

How it works

React renders the urgent update first (the input text), then renders the transition in the background. If you type again, it throws the old background work away and starts over with the latest value.

Where it is used

  • Search boxes that filter big lists
  • Tab switching with slow content
  • Charts and tables that recompute from an input
  • Navigations in router frameworks

useDeferredValue

A slow list that does not block typingTry it Yourself

The input stays smooth because the list uses the deferred value.

useTransition

Tabs with a pending stateTry it Yourself
Tip:Transitions cannot control text inputs directly (the input must update at once). Defer the result, not the typed text.

Quick quiz

1. What does startTransition do?

2. What does useDeferredValue return?

3. What should you defer?

Common questions

What does startTransition do?

Marks an update as non urgent so React can interrupt it. Urgent updates like typing stay responsive.

What does useDeferredValue return?

A copy of the value that may lag behind. It updates after urgent work.

What should you defer?

The result that depends on the input. The input itself must update immediately.