Concurrent React: Transitions & Suspense
Concurrent React allows React to interrupt, pause, or resume component rendering to keep the browser main thread responsive during heavy UI updates. Before Concurrent React, every state update had equal priority, causing input typing latency during heavy list filtering.
With useTransition, you mark non-urgent state updates (such as switching tabs or filtering thousands of search results) as low priority. React keeps the UI interactive for urgent updates (like keystrokes or button clicks) while processing the transition in the background. useDeferredValue defers updating a secondary value until high-priority renders complete.
Exercise
Wrap a heavy tab-switching navigation component in useTransition and display a subtle loading indicator during rendering transitions.
Check your understanding
What is the difference between an urgent and non-urgent update in React?Show answerHide answer
Answer
Urgent updates reflect direct physical interactions (typing, clicking); non-urgent updates transition the view (filtering, switching tabs).What does the isPending boolean returned by useTransition indicate?Show answerHide answer
Answer
It returns true while React is actively processing the background transition render.