deep equality checks, i.e. structural equality is probably not a good idea in useEffect at all. There might be edge cases where it could make sense, but actually, it almost never does.
Hello, I'm Mohammad, the individual behind this blog! I am the founder of Tinylibs and a maintainer of Vitest, Jotai, Valtio, along with a few other libraries.
oh yes, it is a horrible hack :-)
I found this very useful when I tried to understand
useEffect
better: twitter.com/dan_abramov/status/110...deep equality checks, i.e. structural equality is probably not a good idea in
useEffect
at all. There might be edge cases where it could make sense, but actually, it almost never does.Exactly.