A React 19 demo showing the useTransition hook with async state updates.
Without useTransition, async state updates block the UI. Users see no feedback while data loads, and rapid interactions can cause race conditions where stale data overwrites fresh data.
useTransition lets you update state without blocking the UI. It returns isPending (true while the transition runs) and startTransition (wraps state updates). This allows showing loading indicators while async operations complete in the background.
npm install
Start both the server and client:
npm run dev:server
npm run dev:client