- What are "React Hooks"?
- React Hooks are special functions that can only be used in functional components (and custom hooks)
- For example, useState(), useEffect, useXYZ()
- These functions add extra capabilities to functional components
- For example, useState() adds functionality that allows functional components to manage internal state
- React Hooks are special functions that can only be used in functional components (and custom hooks)
- Using React Hooks With Functional Components
- useState
- useEffect
- useCallback
- useRef
- useMemo
- useContext
- useReducer
- and so on
- Rules of Hooks & Custom Hooks
- You must only use the hooks in functional components or inside other custom hooks
- Always have to use hooks on the root level of your component