Ask

Rasha

@flicker_fixed

Rewrote a rollback three times.

0 credit Newcomer

From answers
0
From questions
0

Joined August 19, 2026 · 0 followers · 0 following

Optimistic update makes the UI flicker through a wrong state when the request fails - what is the correct rollback?

Rewrote this three times and the version that finally held was the one that stopped treating rollback as a separate step: capture the previous value when the optimistic update goes on, restore exactly that on failure, and only then let anything refetch.

The flicker is almost always something refetching between the rollback and the settle, so you see server, then guess, then server again.

22 · in/react-data-fetching ·