how does the reducer function understand the state in useReducer code example
Example: what does the useReducer do in react
const [state, dispatch] = useReducer(reducer, initialState);
const [state, dispatch] = useReducer(reducer, initialState);