usereducer with resuce state code example
Example 1: usereducer react
const [state, dispatch] = useReducer(reducer, initialArg, init);
Example 2: what does the useReducer do in react
const [state, dispatch] = useReducer(reducer, initialState);
const [state, dispatch] = useReducer(reducer, initialArg, init);
const [state, dispatch] = useReducer(reducer, initialState);