usereducer react login code example Example: usereducer react const [state, dispatch] = useReducer(reducer, initialArg, init);