Skip to content

Commit

Permalink
⌨️ close: correct type of error field in getFieldState return obj…
Browse files Browse the repository at this point in the history
…ect (#11831)

* fix: correct type of `error` field in `getFieldState` return object

* fix: update reports
  • Loading branch information
cj-young committed May 5, 2024
1 parent 2d94b6e commit 4549afd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion reports/api-extractor.md
Expand Up @@ -665,7 +665,7 @@ export type UseFormGetFieldState<TFieldValues extends FieldValues> = <TFieldName
isDirty: boolean;
isTouched: boolean;
isValidating: boolean;
error?: FieldError;
error?: FieldErrors<TFieldValues>[TFieldName];
};

// @public (undocumented)
Expand Down
4 changes: 2 additions & 2 deletions src/types/form.ts
Expand Up @@ -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 {
Expand Down Expand Up @@ -362,7 +362,7 @@ export type UseFormGetFieldState<TFieldValues extends FieldValues> = <
isDirty: boolean;
isTouched: boolean;
isValidating: boolean;
error?: FieldError;
error?: FieldErrors<TFieldValues>[TFieldName];
};

export type UseFormWatch<TFieldValues extends FieldValues> = {
Expand Down

0 comments on commit 4549afd

Please sign in to comment.