useOptimistic treats confirmed state as the base and layers optimistic updates over it while they are pending.