import React, { FC, useEffect } from "react"; import { Form, Modal, Input } from "antd"; import { FormComponentProps } from "antd/es/form"; interface IPropType extends FormComponentProps{ formatFunctions: string; result: string; open: boolean; onClose: any; } const RunResult: FC = ({ formatFunctions, result, open, onClose, form, }) => { useEffect(() => { if (open) { form.resetFields(); form.setFieldsValue({ formatFunctions, result, }); } }, [open]); const { getFieldDecorator } = form; return ( // @ts-ignore onClose()} width={800} >
{getFieldDecorator("formatFunctions", { initialValue: formatFunctions, })( )} {getFieldDecorator("result", { initialValue: result, })()}
); }; export default Form.create()(RunResult);