Skip to content

Commit

Permalink
root.* error support #107
Browse files Browse the repository at this point in the history
  • Loading branch information
snrmwg committed Sep 9, 2023
1 parent 58378b8 commit e712f2d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ type AsProps<TAs> = TAs extends undefined
? JSX.IntrinsicElements[TAs]
: never;

// accept strings starting with 'root.'
type RootField = `root.${string}`;

export type Props<
TFieldErrors extends FieldErrors,
TAs extends
Expand All @@ -33,7 +36,7 @@ export type Props<
{
as?: TAs;
errors?: TFieldErrors;
name: FieldName<FieldValuesFromFieldErrors<TFieldErrors>>;
name: FieldName<FieldValuesFromFieldErrors<TFieldErrors>> | RootField;
message?: Message;
render?: (data: {
message: Message;
Expand Down

0 comments on commit e712f2d

Please sign in to comment.