Woah isn't that neat now, not only does it make our code more readable, we have made our component more robust by not calling the dispatch when the component is unmounted, also we have memoized our fetch method to save network calls...
But as promised this part is the real deal, we will not only learn how to think and build such an awesome hook but also learn how to develop true generic custom hooks.
Testing is Fun and if you hate it maybe I can change your mind - stay with me.
Lots of the time while abstracting the reusable component it turns into a mess of props. You've probably seen "reusable" components with over 50 props! Those end up being enormously difficult to use and maintain, at the same time it brings performance problems and actual bugs that are hard to track.
This blog compares JavaScript var, let and const based on usage, Scope, and Hoisting. This is unlike any blog on the internet and it covers everything you need to learn about them.
No posts right now.