If I remember correctly, React's default approach of comparing states/props is a shallow comparison (e.g. for PureComponent). That seems about as close to free as you can get.
I use PureComponent everywhere, but I don't know what people do in function-component world.
I use PureComponent everywhere, but I don't know what people do in function-component world.