why usereducer is use in react code example
Example 1: usestate or usereducer
//When it's just an independent element of state you're managing
useState
Example 2: what does the useReducer do in react
const [state, dispatch] = useReducer(reducer, initialState);