getError
Returns the error of the specified field or field array.
const error = getError(form, name, options);
Parameters
formFormStorenamestringoptionsobject ={}shouldActiveboolean =trueshouldTouchedboolean =falseshouldDirtyboolean =false
Explanation
By default undefined is returned if the field is inactive. To change this behavior you can set shouldActive to false.
If you want undefined to be returned when the field is not touched and/or not dirty, you can set shouldTouched and/or shouldDirty to true.
shouldActive, shouldTouched and shouldDirty act like a kind of filter and can be combined with each other.
Return
errorMaybe<string>