我已经处理了几个小时,这确实使我的大脑沸腾了。...
我在函数中有以下代码:
this.setState({disableFixedPeriods, allowApplyFilters: false}, () => {
console.log("APP FINISHED DISABLING FIXED PERIODS: ", this.state.allowApplyFilters)
});
控制台显示“ APP FINABLED DISABLELING FIXED PERIODS:true”
我想念什么吗?
更新:
这是罪魁祸首:
setFilter = (newFilters, callback) => {
let stateFilters = { ...this.state.filters };
let filters = Object.assign(stateFilters, newFilters);
this.setState({ filters, allowApplyFilters: true }, callback);
};