Rules :

1). Every hook is a named export; to import any hook, you must destructure that hook.

Syntax :

Import { hook name} from "react";

2). React hook must be called or used within the functional component or custom hook only, otherwise, it throws an error.

3). Hooks can't be used in return statements.

4). Hooks can't be used in conditional and looping statements.

5). Hooks are specially meant for functional components.

useState hook

useEffect

useRef

UseId

UseReducer

useContext API

Custom hooks