<Formik validate={async() => {
return {
name: 'Not valid'
}
}} onSubmit={() => {}}>
"errors": {}
"errors": {
"name": "Not valid"
},
https://codesandbox.io/s/1oo6z653v7
I found an example. I need to throw exception:throw errors;
<Formik
initialValues={{ name: '' }}
validate={async () => {
const errors = {
name: 'Not valid'
};
throw errors; // OK
}}
onSubmit={() => {}}
>
This seems to be working now. I just tried to reproduce the error in codesandbox:

Errors correctly appear in props.
Is there an issue reported about this?
For future travellers: Formik pre-2.0 used throw errors, v2.0+ uses return errors.
Source: https://github.com/jaredpalmer/formik/releases/tag/v2.0.1-rc.5
This issue can probably be closed.
Most helpful comment
For future travellers: Formik pre-2.0 used
throw errors, v2.0+ usesreturn errors.Source: https://github.com/jaredpalmer/formik/releases/tag/v2.0.1-rc.5
This issue can probably be closed.