allow user to return nothing in submitCallback

Useful when the callback is meant for side effect and not for modifying the data
This commit is contained in:
Eric Burel 2018-09-05 17:08:29 +02:00
parent 5427e994b0
commit 755d5f6ad0

View file

@ -227,7 +227,7 @@ class SmartForm extends Component {
- Nested array item: 'addresses.1.city'
*/
compactParent(data, path);
compactParent(data, path);
}
});
@ -811,7 +811,7 @@ class SmartForm extends Component {
// if there's a submit callback, run it
if (this.props.submitCallback) {
data = this.props.submitCallback(data);
data = this.props.submitCallback(data) || data;
}
if (this.getFormType() === 'new') {