useOptimistic is genuinely one of the nicer additions to React for making an app feel fast, updating the UI immediately while the real request happens in the background. It's also very easy to implement in a way that only handles the success path, leaving the UI confidently showing something that never actually happened once the request fails.
The Setup That Looks Complete
// components/TodoItem.tsx
'use client';
import { useOptimistic } from 'react';






