我正在使用redux表单,我想为一个表单更改调用dispatch两次,但是,使用下面的代码,只有第一次
this.props.dispatch
startDate
得到更新,但是
endDate
handleEvent(event, picker) {
let changeStartDate = change('FilterForm', 'startDate', picker.startDate);
let changeEndDate = change('FilterForm', 'endDate', picker.endDate);
this.props.dispatch(changeStartDate);
this.props.dispatch(changeEndDate);
}
当我把这两个动作作为
this.props.dispatch(changeStartDate, changeEndDate),
只有第一个参数,
在redux窗体中更新。与在单独的线路上调用相同的行为。当我把
changeEndDate
作为第一个参数,“changeEndDate”也会被更改。所以,无论哪个先到,都会以redux形式更新。