Transitions Don't Make Code Faster
What you'll learn: Why useTransition improves user experience without actually speeding up your code's execution.
When you wrap a state update in startTransition, you might expect React to somehow optimize or accelerate that heavy computation. It doesn't. Your expensive filtering, sorting, or rendering logic takes exactly the same amount of time to execute.
What useTransition Actually Does
Think of useTransition like a traffic priority system, not a faster engine. When you mark an update as a transition:
- Urgent updates (like typing in an input) run first and render immediately
- Transition updates (like filtering 10,000 list items) run with lower priority
- React can interrupt the transition work to handle urgent updates
The total CPU time for your heavy operation remains unchanged. The difference is when React does that work and what it shows users meanwhile.
The Perceived Performance Win
Here's the magic: by keeping your input responsive (showing every keystroke immediately) while the heavy update happens in the background, users feel like your app is faster. They see instant feedback where it matters most.
Without useTransition, both the input update and the heavy list filtering block each other, creating lag on every keystroke. With it, the input stays buttery smooth while the list catches up when React has spare cycles.
Don't Confuse Responsiveness with Speed
If your filtering logic takes 500ms to run, it still takes 500ms in a transition. You haven't optimized the algorithm. You've simply prevented that 500ms from making your input field freeze.
Key Takeaway: useTransition improves perceived performance by prioritizing urgent updates and keeping critical UI responsive—it doesn't make slow code execute faster.