We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7807f95 commit 3da2054Copy full SHA for 3da2054
src/validateFieldsNatively.ts
@@ -29,7 +29,7 @@ export const validateFieldsNatively = <TFieldValues extends FieldValues>(
29
const field = options.fields[fieldPath];
30
if (field && field.ref && 'reportValidity' in field.ref) {
31
setCustomValidity(field.ref, fieldPath, errors);
32
- } else if (field.refs) {
+ } else if (field && field.refs) {
33
field.refs.forEach((ref: HTMLInputElement) =>
34
setCustomValidity(ref, fieldPath, errors),
35
);
0 commit comments