Built-in Hooks
Overview of the different types of Hooks introduced in React.
We'll cover the following
What types of hooks are there?
React currently offers ten Hooks for us to use. Of these ten, three are fundamental or basic; the remaining seven are additional (according to the official React documentation). It’s a useful distinction, though, because the three basic Hooks useState()
, useEffect()
and useContext()
will be sufficient in most cases.
The remaining additional Hooks will help us cover edge cases or deal with certain optimizations. For now, we’ll focus on basic Hooks and how we can now implement functionality in function components that were previously reserved for class components.
Note: The following is a list of the additional Hooks provided by React:
useReducer
useCallback
useMemo
useRef
useImperativeHandle
useLayoutEffect
useDebugValue
Get hands-on with 1200+ tech skills courses.