I have reviewed more than 1,000 frontend pull requests.
Like many junior developers, I made some common mistakes when I started,ย especially regard...
For further actions, you may consider blocking this person and/or reporting abuse
Great article, but I disagree with this part, because it assumes that code doesn't change. 5 months from now when we write a new useEffect hook, we don't remember which properties were memoized and which weren't.
I think the rule should be: memoize all application state that will always fail a strict equality check on the next rerender.
Fun fact: in my day-to-day work, I apply this rule. But in this example, I didn't want to because, from what I read online, my situation is not the norm (I am working on a big enterprise app with hundreds of devs and a lot of changes).
Agreed, it's not the norm, but it should be. It would prevent a lot of issues that React devs run into regularly right now.
Hopefully with React compiler coming maybe this year, most of this wonโt be needed anymore ๐