Fang Jin
Aug 20, 2021

--

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`.

--

--

Fang Jin
Fang Jin

Written by Fang Jin

Front-end Engineer, book author of “Designing React Hooks the Right Way” and "Think in Recursion"

Responses (1)