Handle errors gracefully in Next.js with error.tsx boundaries, not-found.tsx custom 404 pages, global error handling, and error recovery with the reset function.
useOptimistic is a React 19 hook that lets you show an immediately updated UI while an async server operation is in progress, then reconcile the real result when it arrives. Learn how to implement it correctly with rollback handling.