3 ms·
Still shallow. We usually recommend avoiding deep checks because (a) the concept of deep equality is pretty nebulous and hard to design in a predictable, prec
by sophiebits 8y ago
Still shallow.
We usually recommend avoiding deep checks because
(a) the concept of deep equality is pretty nebulous and hard to design in a predictable, precise way, and
(b) deep equality checking can be slow, often just as slow (or slower) than the actual rerender – in which case the memoization is only hurting you.
(If you want to do deep equality anyway, you can pass a second argument to React.memo to specify a custom comparator.)
- throwaway3265 8y agoI agree about those statements, just curious since that was probably the most important concept I had to learn about "advanced" React.