Member-only story
Hot take š„. React Hooks are bad for your code. Hereās why!
Iāve recently developed a dislike for hooks after trying to refactor some old React code, Iāve come to the realisation that hooks are not great for abstraction. Yes I know you can create custom hooks but they donāt quite solve the issues I raise. I present some weak solutions in this article but ultimately, I think there needs to be more freedom on how and where hooks are used in the codebase.
Also, React plugin authors should stop making tools that only work with hooks. There are other ways to run things in Javascript.
Note: This is 100% my opinion. Iām not a massive deal in the web dev world so donāt take what I say as gospel. Do what works best for your team and your project. Also, please read this article to the very end before forming an opinion.
Watch this article on YouTube
If youāre more of a watcher than a reader, go ahead and click on the video below. Otherwise, enjoy the rest of this article š