arrow_backBACK TO DRILLS
Blue Beltstate-snapshotslockPREMIUM

Async stale state in delayed updates

A component tracks pending requests. Inside an async click handler, it runs:

REACT_MODULE // 0x42
setPending(pending + 1);
await delay(3000);
setPending(pending - 1);

Why can the counter become negative?

lock

This Drill is Locked

This is a premium drill. Continue on to the next free drill in the sequence.

CONTINUE DRILLarrow_forward
BugDojo
BlogFAQ

© 2026. Carved in code.