esbenp / react-native-clean-form

Easy react-native forms using bootstrap-like syntax with redux-form+immutablejs integration. Styled using styled-components
http://esbenp.github.io/2017/01/06/react-native-redux-form-immutable-styled-components/
MIT License
478 stars 83 forks source link

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

Open The-Code-Monkey opened 6 years ago

The-Code-Monkey commented 6 years ago

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