React Hooks are a very powerful tool to add interactivity and features to user interfaces. As your application grows, you will increasingly rely on hooks, composing simple ones into complex hooks, and, before you know it, end up with an unreadable, unmaintainable mess that rerenders 5 times a second for no apparent reason. In this article, I will show you some React Hooks antipatterns and how to avoid them if you want a clean, readable, and robust application.
read more “Getting Out of Hook Hell: You Are Using React Hooks The Wrong Way”Tag: hooks
React.useMemo and when you should use it
As your application scales, performance issues become more and more evident. While React is very well optimized and fast out-of-box, it is important to know the instruments it provides to make your code even faster. One of such instruments is React.useMemo
hook and its sidekick, React.useCallback
.