Returns the current errors of the form fields or a field array.
// Get errors of each field const errors = getErrors(form, options); // Get errors of a field array const errors = getErrors(form, name, options); // Get errors of specific fields const errors = getErrors(form, names, options);
Besides the names of fields, you can also specify the name of a field array under
names to get the value of each contained field.
By default, only the errors of fields that are currently active are returned. If you want errors of inactive fields to be returned as well, you can set
By default, the errors of fields that are not touched and not dirty are also returned. If you want only the errors of the touched and/or dirty fields to be returned, you can set
shouldDirty act like a kind of filter and can be combined with each other.