Skip to content

Commit 2f9d0ab

Browse files
committed
form validate should return undefined in case of no error
1 parent f51acb7 commit 2f9d0ab

File tree

1 file changed

+2
-2
lines changed
  • client/src/components/formHelpers

1 file changed

+2
-2
lines changed

client/src/components/formHelpers/form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ function DynamicForm({
4949
validate={(values: URLValues) => {
5050
const hasMissingRequiredFields = options.required?.some((field: string) => !values[field]);
5151

52-
return {
52+
return hasMissingRequiredFields ? {
5353
[FORM_ERROR]: hasMissingRequiredFields,
54-
}
54+
} : undefined
5555
}}
5656
>
5757
{({ handleSubmit, pristine, error }) => (

0 commit comments

Comments
 (0)