optimistic UI
Updating the screen immediately as if an action succeeded, before the server confirms it, and undoing the change if it fails.
In more detail
A like button that increments instantly feels faster than one that waits for the network. React's useOptimistic shows the optimistic value while the action runs and falls back to the real server state when it ends.
Related terms
- useOptimistic — The React hook that shows a temporary optimistic value while an Action is pending, then returns to the real state when it settles.
- rollback — Returning a system to a previous known-good version after a bad change.
- startTransition — A React function that marks state updates, including async actions, as a transition that can run without blocking the interface.
Taught in
- Action State: useActionState & Optimistic Form UI — Next.js 15 & Modern App Router Architecture
- Optimistic UI: useOptimistic Rollbacks & Transitions — Next.js 15 & Modern App Router Architecture