What are the hooks?
Hooks are a new feature in React >= 16.8 which allows you to use React features without having to write class components.
Uses of Hooks:
1.) Allows you to use React Feature without writing a class.
2.) Avoid the confusion by 'this' keyword
3.) Allows you to reuse stateful logic
4.) Allows you to organize the logic inside the component into reusable isolated units.
Rules to use Hooks:
Rule1: "Always call hooks on the top level."
Do not call hooks in the loops, conditions, and at the
Rule2: "Always call hooks from the React functions."
but rather always call it from React Functional components.
- Jayant Khandelwal