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
React 19 · State and effects
Pass a function when the new value depends on the old one.
setCount((c) => c + 1);
Official React 19 documentation
Was this page helpful?