ant design form validation in the modal
const [isOpen, setIsOpen] = useState(false);
const [form] = Form.useForm();
const onSubmit = useCallback((values) => {
// do your staff with values
}, []);
const closePopup = useCallback(() => {
form.resetFields();
setIsOpen(false);
}, [form]);
<Modal
visible={isOpen}
onOk={form.submit}
onCancel={closePopup}
>
<Form
form={form}
onFinish={onSubmit}
/>
</Modal>