Q34: What is the useTransition hook and how does startTransition work?
useTransition allows marking state updates as non-urgent transitions. Urgent updates (typing text) interrupt non-urgent transitions (filtering a 10,000 item list), keeping the input frame rate smooth.
Key Takeaways
startTransition(() => setState())marks updates as low-priority transitions.- Returns
[isPending, startTransition]tuple to monitor background pending state.
Knowledge Check
What is the boolean flag returned by the useTransition hook tuple?