import type { FormInstance } from 'antd'; import { Button, Form, Input, Space } from 'antd'; import React from 'react'; 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 = () => { const [form] = Form.useForm(); return (
); }; export default App;