Passing an object in setState() without creating a new reference
A common React performance pitfall is passing objects to setState() (or state setters in functional components) without creating new references, which can lead to unexpected behavior and missed updates. The….