import React, { useState } from 'react'; import { Button, Form, Input, Modal, Radio } from 'antd'; interface Values { title?: string; description?: string; modifier?: string; } const App: React.FC = () => { const [form] = Form.useForm(); const [formValues, setFormValues] = useState(); const [open, setOpen] = useState(false); const onCreate = (values: Values) => { console.log('Received values of form: ', values); setFormValues(values); setOpen(false); }; return ( <>
{JSON.stringify(formValues, null, 2)}
setOpen(false)} destroyOnClose modalRender={(dom) => (
onCreate(values)} > {dom}
)} > Public Private
); }; export default App;