Skip to main content
useTransition is a React Hook that lets you update the state without blocking the UI.

Parameters

useTransition does not take any parameters.

Returns

useTransition returns an array with exactly two values:
boolean
The isPending flag that tells you whether there is a pending transition.
(callback: () => void, options?: StartTransitionOptions) => void
The startTransition function that lets you mark a state update as a transition.
  • callback: A function that updates state. React will immediately call this function, marking all state updates scheduled synchronously during this function call as transitions.
  • options: Optional object with a name property (string) for debugging in React DevTools.

Usage

Marking a state update as a non-blocking transition

Call useTransition at the top level of your component to mark state updates as transitions:

Updating the parent component in a transition

You can call startTransition from a child component to update parent state:

Displaying a pending visual state during the transition

Show loading indicators while the transition is pending:

Preventing unwanted loading indicators

In this example, the PostsTab component fetches data using Suspense. When you click the “Posts” tab, it immediately shows a pending state:

Common Patterns

Search with transitions

Form submission with transitions

Filtering with transitions

TypeScript

Troubleshooting

Updating an input in a transition doesn’t work

You can’t use transitions for state that controls an input:

React doesn’t treat my state update as a transition

Make sure the state update is inside the startTransition callback:

My transition never finishes

Transitions that involve async work might not show as pending:

useTransition vs useDeferredValue

Best Practices

Keep urgent updates outside transitions

Use meaningful loading states

Combine with Suspense