formsy-react
formsy-react copied to clipboard
Form.getErrors()
Is there a way to get all the errors from form? Or at least to get the field with error?
I need the same thing.
I find a solution for that. You can iterate all the fields on the form ( inputs property ) and get all the errors. I needed to find the first field with error because I need to focus on that field.
Good solution, but I don't like how this is working internally. Validation errors live in form field state and we call field's setState() from from via ref. Might be a good idea to look into moving this state into the form and passing it down to fields for 2.0.