useReducer는 여러 useState setter를 흩뿌리는 대신, state 전이를 단일 순수 reducer 함수에 중앙화합니다. 이는 Redux 패턴의 React 내장 버전입니다.
jsx
() {
(action.) {
: { : state. + };
: { ...state, : action. };
: { : , : };
: state;
}
}
() {
[state, dispatch] = (reducer, { : , : });
;
}
