Rules for Writing React Hooks
React is a library for creating front end views. It has a big ecosystem of libraries that work with it. Also, we can use it to enhance existing apps.
In this article, we’ll look at some rules for writing hooks.
Only Call Hooks at the Top Level
We shouldn’t call hooks inside loops, conditions or nested functions.