I will do few updates to your code, 1 - Wrap setOptimisticIsFavorited in startTransition to properly handle the optimistic update. 2 - Add error handling and reset optimistic state on failure 3 - Disable the button during transitions to prevent multiple clicks 4 - Add proper error boundaries around the async operation