Skip to content

Commit

Permalink
made error field show only when there is an error
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijv256 committed Nov 25, 2023
1 parent 02ff7fb commit 68be61d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Components/Form/FormFields/FormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ const FormField = ({
)}
</div>
<div className={field?.className}>{children}</div>
<FieldErrorText error={field?.error} className={field?.errorClassName} />
{field?.error ? (
<FieldErrorText
error={field?.error}
className={field?.errorClassName}
/>
) : null}
</div>
);
};
Expand Down

0 comments on commit 68be61d

Please sign in to comment.