From c9e96668ff08c44cc60ff0804f19dccf9377f4a5 Mon Sep 17 00:00:00 2001 From: Alberto Defendi <1369-ahl-berto@users.noreply.gitlab.inf.unibz.it> Date: Tue, 4 May 2021 14:51:25 +0200 Subject: [PATCH] Make rule property optional Components may not need a rule property. Defaulting to undefined. --- src/components/AuthUser/InputField/InputField.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/AuthUser/InputField/InputField.tsx b/src/components/AuthUser/InputField/InputField.tsx index ee002a4..758c1f4 100644 --- a/src/components/AuthUser/InputField/InputField.tsx +++ b/src/components/AuthUser/InputField/InputField.tsx @@ -27,7 +27,7 @@ type Props = { /** * Validation rules. */ - rules: Partial<unknown>; + rules?: Partial<unknown>; }; export const InputField: FC<Props> = (props: Props) => { @@ -58,3 +58,7 @@ export const InputField: FC<Props> = (props: Props) => { /> ); }; + +InputField.defaultProps = { + rules: undefined, +}; -- GitLab