Skip to content

Commit

Permalink
[@mantine/form] Fix incorrect values type in validation rules (#3110)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-rb committed Dec 5, 2022
1 parent 4f91eb7 commit 184515a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mantine-form/src/types.ts
Expand Up @@ -30,11 +30,11 @@ type FormRule<Value, Values> = NonNullable<Value> extends Array<infer ListValue>
}>
| Rule<Value, Values>
: NonNullable<Value> extends Record<string, unknown>
? FormRulesRecord<Value> | Rule<Value, Values>
? FormRulesRecord<Value, Values> | Rule<Value, Values>
: Rule<Value, Values>;

export type FormRulesRecord<Values> = Partial<{
[Key in keyof Values]: FormRule<Values[Key], Values>;
export type FormRulesRecord<Values, InitValues = Values> = Partial<{
[Key in keyof Values]: FormRule<Values[Key], InitValues>;
}>;

export type FormValidateInput<Values> = FormRulesRecord<Values> | ((values: Values) => FormErrors);
Expand Down

0 comments on commit 184515a

Please sign in to comment.