How could I disable form submit button using antd
Form validations work, but I need to visually disable form submit button when validation fails
This is a stackblitz url https://stackblitz.com/edit/react-ts-z5d6tr?file=Hello.tsx
I found some elegant way to perform this
<Form.Item shouldUpdate className="submit">
{() => (
<Button
type="primary"
htmlType="submit"
disabled={
!form.isFieldsTouched(true) ||
form.getFieldsError().filter(({ errors }) => errors.length)
.length > 0
}
>
Log in
</Button>
)}
</Form.Item>