useReducer in react ts code example Example: what does the useReducer do in react Click to copyconst [state, dispatch] = useReducer(reducer, initialState);