This Hook is an alternative to useState, and works similarly to the Redux library. We can use it as follows:
import { useReducer } from 'react'
const [ state, dispatch ] = useReducer(reducer, initialArg, init)
The useReducer Hook is used to deal with complex state logic.