From 4549afd5afa8a824a1522e75f776083e4168aac6 Mon Sep 17 00:00:00 2001 From: CJ Young <124476300+cj-young@users.noreply.github.com> Date: Sun, 5 May 2024 03:32:48 -0400 Subject: [PATCH] =?UTF-8?q?=E2=8C=A8=EF=B8=8F=20close:=20correct=20type=20?= =?UTF-8?q?of=20`error`=20field=20in=20`getFieldState`=20return=20object?= =?UTF-8?q?=20(#11831)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: correct type of `error` field in `getFieldState` return object * fix: update reports --- reports/api-extractor.md | 2 +- src/types/form.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reports/api-extractor.md b/reports/api-extractor.md index e47bcefe739..5371dbc1df9 100644 --- a/reports/api-extractor.md +++ b/reports/api-extractor.md @@ -665,7 +665,7 @@ export type UseFormGetFieldState = [TFieldName]; }; // @public (undocumented) diff --git a/src/types/form.ts b/src/types/form.ts index ba3b7e0c570..7e6aae4a790 100644 --- a/src/types/form.ts +++ b/src/types/form.ts @@ -3,7 +3,7 @@ import React from 'react'; import { VALIDATION_MODE } from '../constants'; import { Subject, Subscription } from '../utils/createSubject'; -import { ErrorOption, FieldError, FieldErrors } from './errors'; +import { ErrorOption, FieldErrors } from './errors'; import { EventType } from './events'; import { FieldArray } from './fieldArray'; import { @@ -362,7 +362,7 @@ export type UseFormGetFieldState = < isDirty: boolean; isTouched: boolean; isValidating: boolean; - error?: FieldError; + error?: FieldErrors[TFieldName]; }; export type UseFormWatch = {