我正在使用react-redux来进行api调用。问题是如何在保存/插入新行时执行动作的重新获取
src.forEach( function( x ) { dest.push(x); });
代码在线https://codesandbox.io/s/o5430k7p4z,相关文件为class AddServiceForm extends Component {
handleSaveBtnClick = () => {
const { columns, onSave } = this.props;
let params = new URLSearchParams();
this.props.addServices(params) // i need to find out result of this action???
};
render() {
const {
onModalClose,
onSave,
columns,
validateState,
ignoreEditable
} = this.props;
//const { columns, validateState } = this.props;
return (
<div className="modal-content">
//modal form
</div>
);
}
}
function mapStateToProps(state) {
return {
servicesAdd: state.servicesAdd
};
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(
{ addServices },
dispatch
);
}