state snapshot

The idea that during one render every state value is fixed, so code in that render always sees the same value even after calling a setter.

In more detail

Calling setCount(count + 1) three times in one click still adds only one, because each call reads the same snapshot value. The new value appears in the next render. Updater functions avoid the problem by receiving the latest pending value instead.

Related terms

Taught in

References