What are the rules that must be followed while using React Hooks?

Full Stack Developer with a passion for building web applications. PHP, Node.js, Laravel, MySQL, MongoDB. Love collaborating & making a difference
Only Call Hooks at the Top Level
Don’t call Hooks inside loops, conditions, or nested functions.
Only Call Hooks from React Functions
Don’t call Hooks from regular JavaScript functions.
Sources:
Rules of Hooks –. (n.d.). React. https://reactjs.org/docs/hooks-rules.html




