advantages of usereducer in react code example Example: what does the useReducer do in react const [state, dispatch] = useReducer(reducer, initialState);