React ~ Hooks ~ Overview - rohit120582sharma/Documentation GitHub Wiki

Hooks are special functions that let you hook React's state, lifecycle methods, and sharing non-visual logic features from function components.

The real purpose of Hooks system is to make it easy to share the logic between components.

Hooks are JavaScript functions, but they impose two additional rules:

  • Only call them at the top level. Don’t call them inside loops, conditions, or nested functions.
  • Only call them from React's Functional Components or your own custom hooks. Don’t call them from regular JavaScript functions.


⚠️ **GitHub.com Fallback** ⚠️