1const [isOpen, setIsOpen] = useState(false);
2const [form] = Form.useForm();
3
4const onSubmit = useCallback((values) => {
5// do your staff with values
6}, []);
7
8const closePopup = useCallback(() => {
9 form.resetFields();
10 setIsOpen(false);
11}, [form]);
12
13<Modal
14 visible={isOpen}
15 onOk={form.submit}
16 onCancel={closePopup}
17>
18 <Form
19 form={form}
20 onFinish={onSubmit}
21 />
22</Modal>
1 <Modal
2 okButtonProps={{form:'category-editor-form', key: 'submit', htmlType: 'submit'}}
3 onCancel={() => {
4 dispatch({
5 type: 'categoryEditor/closeEditor'
6 })
7 }}>
8 <Form id='category-editor-form' layout="vertical" onFinish={onFinish}>
9
10 </Form>
11