Skip to content

Commit

Permalink
馃懏 fix #5538 type error with setError shouldFocus
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebill1049 committed Jun 10, 2021
1 parent fd7664c commit 6290d87
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/types/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@ export type FieldError = {
message?: Message;
};

export type ErrorOption =
| {
types: MultipleFieldErrors;
shouldFocus?: boolean;
}
| {
message?: Message;
type?: LiteralUnion<keyof RegisterOptions, string>;
shouldFocus?: boolean;
};
export type ErrorOption = {
message?: Message;
type?: LiteralUnion<keyof RegisterOptions, string>;
types?: MultipleFieldErrors;
};

export type FieldErrors<TFieldValues extends FieldValues = FieldValues> =
DeepMap<TFieldValues, FieldError>;
Expand Down

0 comments on commit 6290d87

Please sign in to comment.