For a quick and dirty reduction in wall-time and wasted renders, you can use lodash’s isEqual in…
Timothy Laurent

Using a deep equality comparison only solves the ‘Object Copying’ problem. You still have to watch out for the other gotchas mentioned in the post :)

Also, be careful with _.isEqual since the performance characteristics are harder to reason about, especially if you are using complex objects in your props / state. As with any performance optimizations, profile your code first to see if the optimization is worth it.

Like what you read? Give Dounan Shi a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.