React

React Hooks

Rules of Hooks

Don’t call Hooks inside loops, conditions, or nested functions. Instead, always use Hooks at the top level of your React function.

Don’t call Hooks from regular JavaScript functions. Instead, you can:

-> Call Hooks from React function components.

-> Call Hooks from custom Hooks