arrow_backBACK TO DRILLS
Blue Beltstate-basics
Tracking Mouse Coordinates as Separate State
A component stores mouse coordinates as separate x and y state variables, but every interaction updates them together. Why might combining them into a single object state improve the component design?