that's not true. Functional component especially won't do a shallow comparison. It only does a `object.is`. The reason why it's working is because useState doesn't normally group all properties together like `setState` in class component.
This article tells us use `React.memo`.