React 19 · State and effects

Update state from the previous value

Pass a function when the new value depends on the old one.

setCount((c) => c + 1);

Official React 19 documentation

More state and effects commands

All state and effects commands · React 19 cheatsheet

Was this page helpful?