Skip to main content

useTransition and startTransition deep dive

Transitions let React treat some state updates as non-urgent so urgent interactions can stay responsive while the next UI prepares.

const [isPending, startTransition] = useTransition();

function selectTab(nextTab) {
startTransition(() => {
setTab(nextTab);
});
}
Urgent and Transition updates express different priorities
RESPOND NOWUrgent update

Typing, pressed state, focus, drag position, direct control feedback.

CAN PREPARETransition update

Navigation, expensive tab content, large filtered views, heavy presentation changes.

Transitions do not create threads, workers, or delayed timers. They change how React schedules rendering work.

useTransition vs standalone startTransition​

const [isPending, startTransition] = useTransition();

useTransition gives local pending state plus a Transition starter.

import { startTransition } from 'react';

startTransition(() => {
setRoute(nextRoute);
});

Standalone startTransition is useful outside component Hook scope or when pending state is managed elsewhere.

The callback runs immediately​

startTransition(() => {
console.log('runs now');
setPage('/reports');
});
startTransition does not delay the callback
Call startTransition
Eligible state setters are marked as Transition updates
Background rendering may be interrupted

Rendering is interruptible​

If urgent work arrives while React prepares a Transition render, React can prioritize the urgent work and later resume or restart the background work.

1Start expensive Transition render
2User types
3Urgent input render wins
4Obsolete work may be abandoned
5Transition restarts with latest state

This is why rendering must remain pure: a render can happen without committing.

Transitions cannot control text inputs​

Bad:

function handleChange(event) {
startTransition(() => {
setQuery(event.target.value);
});
}

Good:

function handleChange(event) {
setQuery(event.target.value);
}

Then defer expensive dependent presentation with useDeferredValue, or update separate downstream state inside a Transition.

Pending state is feedback, not a global lock​

const [isPending, startTransition] = useTransition();
A pending Transition should keep the interface understandable
Current UI
Can remain usable.
Pending feedback
Shows that the action/navigation was accepted.
Next UI
Prepares without blocking unrelated urgent work.

Transitions and Suspense​

A Transition can prevent already revealed content from being replaced by an unwanted fallback while the new UI prepares.

Suspense behavior during a non-urgent update
Without Transition
Old page → fallback → new page.
With Transition
Old page + pending feedback → new page.

New nested boundaries can still reveal their own local fallbacks after the next shell commits.

Async Transition Actions and await​

Modern React accepts async Actions passed to Transition starters.

startTransition(async () => {
await saveDraft();

startTransition(() => {
setStatus('saved');
});
});

Current React has an important limitation: state updates after an await need another startTransition wrapper to be marked as Transition updates.

Transition scope across await
Outer Transition Action starts
Async boundary
React currently loses Transition marking for later setters.
Nested startTransition
Commit next UI

This is current API behavior and a documented limitation, not a general JavaScript rule.

Multiple ongoing Transitions​

React currently may batch multiple ongoing Transitions together. isPending is therefore not a request identifier or fine-grained transaction record.

If you need request-specific ordering, cancellation, retries, or mutation identity, model those in the data layer.

Render priority is not network consistency​

A Transition cannot solve stale response ordering
Request A starts
Request B starts
Newer B result
Older A must not overwrite B

Use request IDs, cancellation, mutation ordering, or framework/data-layer primitives for consistency.

Choose the tool that matches the problem
Transition
Prioritize React rendering for an update you initiate.
useDeferredValue
Let one consumer lag behind an already-changing value.
Debounce
Delay when work starts.
Web Worker
Move suitable computation to another thread.

A Transition has no fixed timer and does not rate-limit network requests or arbitrary computation.

Render cost still matters​

Transitions change priority, not cost. If rendering is expensive, you may still need better state placement, memoization, virtualization, smaller DOM, better algorithms, or off-main-thread computation.

Event, Effect, and Action ownership​

Where should this work happen?
User intent causes the operationEvent / Action logic
UI must synchronize with external system after commitEffect
Update is expensive but non-urgentTransition around the relevant state update
Render contains side effectsMove them out; render must stay pure

Production example: tab switch​

function Tabs() {
const [tab, setTab] = useState('overview');
const [isPending, startTransition] = useTransition();

function select(nextTab) {
startTransition(() => {
setTab(nextTab);
});
}

return (
<>
<TabBar tab={tab} onSelect={select} pending={isPending} />
<Suspense fallback={<PanelSkeleton />}>
<TabPanel tab={tab} />
</Suspense>
</>
);
}

Design whether the tab indicator is urgent, whether old panel content remains visible, where pending feedback appears, and which nested regions may reveal independently.

Common mistakes​

  • wrapping every update in a Transition;
  • transitioning controlled input state;
  • treating isPending as a network request object;
  • expecting Transitions to fix very expensive rendering without profiling;
  • confusing render priority with request ordering;
  • performing side effects during render.

Debugging checklist​

  1. Which setter is inside the Transition?
  2. Is input/control state accidentally non-urgent?
  3. Does expensive work come from another urgent update?
  4. Does Suspense activate?
  5. Is pending feedback useful?
  6. Are post-await setters wrapped correctly?
  7. Are request-ordering problems handled separately?
  8. Is rendering safe to interrupt and restart?

Exercise​

Build a slow analytics tab screen. Compare synchronous tab state to Transition-based tab changes, add pending feedback and a lazy/Suspense chart, then rapidly switch tabs and explain which render work React may abandon.

Interview questions​

Beginner: What is the difference between an urgent and Transition update?

Intermediate: Why can't a Transition control a text input value?

Senior: How do interruption, Suspense preservation, async ordering, and pending UX interact during route navigation?

Summary​

Transition mental model
Mark eligible update as non-urgent
Urgent work may interrupt
Latest valid result commits

References​

Next​

Next, learn how useDeferredValue lets a specific value lag behind urgent state.