useReducer รวมศูนย์ state transitions ใน pure reducer function เดียว แทนที่จะกระจาย useState setters จำนวนมาก เป็น Redux pattern เวอร์ชัน built-in ของ React
jsx
() {
(action.) {
: { : state. + };
: { ...state, : action. };
: { : , : };
: state;
}
}
() {
[state, dispatch] = (reducer, { : , : });
;
}
