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

Taught in

References