import React from 'react'; import type { FormInstance } from 'antd'; import { Button, Form, Input, Space } from 'antd'; const SubmitButton = ({ form }: { form: FormInstance }) => { const [submittable, setSubmittable] = React.useState(false); // Watch all values const values = Form.useWatch([], form); React.useEffect(() => { form.validateFields({ validateOnly: true }).then( () => { setSubmittable(true); }, () => { setSubmittable(false); }, ); }, [values]); return ( ); }; const App: React.FC = () => { const [form] = Form.useForm(); return (