arrow_backBACK TO DRILLS
Black Beltimmutability

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?

BugDojo
BlogFAQ

© 2026. Carved in code.