useTransition
The React hook that returns an isPending flag and a startTransition function for marking state updates as non-urgent transitions.
In more detail
Keep the input value in ordinary state and wrap the expensive update, such as the filtered results, in startTransition; typing stays smooth while isPending shows a loading hint. The standalone startTransition function does the same where hooks cannot be used, without the pending flag.
Example
const [isPending, startTransition] = useTransition();Related terms
- transition — A React state update marked as not urgent, which React may interrupt or delay so urgent input stays responsive.
- pending state — The in-between state while asynchronous work, such as a transition or form submission, has started but not finished.
- urgent update — A state change that users expect to see immediately, such as typed characters or a toggled checkbox.
Taught in
- Concurrent Mode: Interruptible Work And Lane Priority — React 19 & Modern Component Architecture
- useTransition: Non-Blocking State Updates for Fluid UI — React 19 & Modern Component Architecture
- useOptimistic: Instantaneous UI Updates with Rollback — React 19 & Modern Component Architecture