arrow_backBACK TO DRILLS
Black Belt - Hardstate-snapshots

Mixing replacement and updater state updates

A counter starts at 0. Inside one click handler, React runs:

//REACT_MODULE
setNumber(number + 5);
setNumber(n => n + 1);

What will the counter display after the next render?

BugDojo
BlogFAQ

© 2026. Carved in code.