useReducer tiċċentralizza state transitions f'funzjoni waħda pure reducer, minflok li tespandi ħafna setters useState. Din hija l-verżjoni built-in ta' React tal-mudell Redux.
jsx
() {
(action.) {
: { : state. + };
: { ...state, : action. };
: { : , : };
: state;
}
}
() {
[state, dispatch] = (reducer, { : , : });
;
}
