react-native-clean-form icon indicating copy to clipboard operation
react-native-clean-form copied to clipboard

How to tell if validate has no errors and stop the form submit.

Open The-Code-Monkey opened this issue 6 years ago • 0 comments

const submit = (values, dispatch) => { const promise = new Promise((resolve) => { resolve(); }); console.warn(promise); };

I have that as my form submit how do i work out if any of these have errored

`validate: (values) => { const errors = {};

if (values.test === 0) {
    errors.test = "test erroring"
}

return errors;

};`

i just want to do it as its a form that gets a specific form based on the fields here and i need them all to be able to submit

The-Code-Monkey avatar Jun 12 '18 13:06 The-Code-Monkey