arrow_backBACK TO DRILLS
Black BeltimmutabilitylockPREMIUM

Set mutation in React state

A component stores a Set in state and directly calls selectedIds.add(id) before passing the same Set back into setSelectedIds(selectedIds). Why might React fail to re-render?

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.