Skip to content

Commit

Permalink
Revert "⌨️ close: correct type of error field in getFieldState re…
Browse files Browse the repository at this point in the history
…turn object (react-hook-form#11831)"

This reverts commit 4549afd.
  • Loading branch information
bluebill1049 committed May 23, 2024
1 parent bed340c commit 927535b
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
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ export type UseFormGetFieldState<TFieldValues extends FieldValues> = <TFieldName
isDirty: boolean;
isTouched: boolean;
isValidating: boolean;
error?: FieldErrors<TFieldValues>[TFieldName];
error?: FieldError;
};

// @public (undocumented)
Expand Down
4 changes: 2 additions & 2 deletions src/types/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { VALIDATION_MODE } from '../constants';
import { Subject, Subscription } from '../utils/createSubject';

import { ErrorOption, FieldErrors } from './errors';
import { ErrorOption, FieldError, 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?: FieldErrors<TFieldValues>[TFieldName];
error?: FieldError;
};

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

0 comments on commit 927535b

Please sign in to comment.