useReducer is one out of fifteen (15) built in react hooks. it helps in managing multiple states that relates to each other example would making an api request or handling multiple form fields
The function of the useReducer hook is based on managing multiple states that are related to each other
The useState hook can be used to manage one or two states but when there are multiple states, creating so many useState hooks can get messy.
Its a good idea to use the useReducer hook to manage multiple states and as well improve readability (dry) ☀️
*** The code show how to use the useReducer hook to manage multiple states in this case we are making an api request to fetch user informations from an external database.
Read more: https://medium.com/@okeresamuel360/the-usereducer-hook-in-react-5b3a4af93af5