Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumReactuseReducerSingle-choice MCQ

Inside an event handler you dispatch twice in a row using the same `dispatch` from useReducer. The reducer increments `count` by 1 each time. What is `count` after the handler runs, starting from 0?

function reducer(state, action) { if (action.type === 'inc') return { count: state.count + 1 }; return state; } function handleClick() { dispatch({ type: 'inc' }); dispatch({ type: 'inc' }); }