4 ms·
I upvoted because yes. in practice, pick your battles. Also then in practice, you'll get people shrugging off their hooks get called 10 times iso 1. then mayb
by trgn 3y ago
I upvoted because yes.
in practice, pick your battles.
Also then in practice, you'll get people shrugging off their hooks get called 10 times iso 1. then maybe add useMemo everywhere just to be sure. Hmm.. still kind of weird. Maybe sprinkle in some more if-thens, that will fix it! Deep breaths..
- dynamite-ready 3y agoThis is the true legacy of React, and it's awful. It's not just a case of "you're doing it wrong", because even cutting edge codebases (developed in the last 1 or so) are struggling with this. "useMemo is the solution" many will tell you. Compared to the way things are handled in Vue, useCallback and useMemo are near enough code smells for something rotting in the center of the React codebase.