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);
});
}
Typing, pressed state, focus, drag position, direct control feedback.
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');
});
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.
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();
Transitions and Suspense
A Transition can prevent already revealed content from being replaced by an unwanted fallback while the new UI prepares.
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.
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
Use request IDs, cancellation, mutation ordering, or framework/data-layer primitives for consistency.
Transition vs related tools
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
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
isPendingas 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
- Which setter is inside the Transition?
- Is input/control state accidentally non-urgent?
- Does expensive work come from another urgent update?
- Does Suspense activate?
- Is pending feedback useful?
- Are post-
awaitsetters wrapped correctly? - Are request-ordering problems handled separately?
- 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
References
- https://react.dev/reference/react/useTransition
- https://react.dev/reference/react/startTransition
- https://react.dev/reference/react/Suspense
Next
Next, learn how useDeferredValue lets a specific value lag behind urgent state.