ReplyAug 28, 2019
Your explanation is very clear, but I think the complexity of shallow comparison is cheap, it would be O( n ) with n is the number of keys in props. Besides that, if you already read this article https://reactjs.org/docs/optimizing-performance.html, you can see to render a component React do two steps first it check the shouldComponentUpdate function, then it check the virtual DOMs. So how to you think about the cost to check shouldComponentUpdate (with shallow comparison) and the virtual DOMs, which one is cheaper? In my opinion, the cost to check virtual DOMs is more expensive.