What useTransition Solves: The Blocking UI Problem
You'll learn: Why expensive state updates can freeze your UI and make interactions feel unresponsive.
The Blocking Problem
When you update state in React, the component re-renders. Simple enough — but what happens when that update is expensive? Imagine typing in a search box that filters 10,000 items. Every keystroke triggers a state update, React re-renders the filtered list, and your browser has to do a lot of work.
Here's the issue: by default, React treats all state updates as urgent. When you type a character, React blocks everything else until it finishes rendering the new filtered list. Your cursor freezes mid-keystroke. The UI feels laggy and broken.
The Real-World Experience
Think of it like a busy restaurant kitchen. The chef (React) gets two orders:
- "Customer is typing another letter" (high priority — instant feedback needed)
- "Recalculate and display 10,000 filtered items" (lower priority — can wait a moment)
Without a way to prioritize, the chef stops everything to prepare the massive order, leaving the customer standing at the counter with no acknowledgment.
Why It Happens
JavaScript is single-threaded. Expensive rendering work — like mapping over thousands of items, creating virtual DOM nodes, and diffing them — blocks the main thread. User input events get queued up, waiting for React to finish. The interface feels "frozen" even though it's just... really busy.
Key Takeaway: The blocking UI problem occurs when expensive state updates monopolize the rendering thread, preventing React from responding to user input and making your app feel sluggish and unresponsive.