3 ms·
If you’re a principal, just ask your juniors to explain their useEffect()-based mess. When they can’t, mandate class components.
by plugin-baby 3y ago
If you’re a principal, just ask your juniors to explain their useEffect()-based mess. When they can’t, mandate class components.
- ipaddr 3y agoThen you get a security audit that you are not using the latest whatever and c-suites panic
- trgn 3y agoI 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.
- yazaddaruvala 3y agoIf you're a principal, you should be able to keep up with modern tools. Making sure the engineers around you are as productive as possible with their current tools and processes is literally your job! If as a principal, you are no longer able to keep up with tooling / patterns that everyone else at your company wants to use, its time to take a smaller scope or time to retire. The job, including mandates (if any are needed) is to empower the people you work with, not to stifle them.