= ({ issue, handleSubmit }) => {
// states
// const [issueFormValues, setIssueFormValues] = useState({
// name: issue.name,
// description: issue?.description,
// description_html: issue?.description_html,
// });
const [issueName, setIssueName] = useState(issue?.name);
const [issueDescription, setIssueDescription] = useState(issue?.description);
const [issueDescriptionHTML, setIssueDescriptionHTML] = useState(issue?.description_html);
// hooks
const formValues = useDebounce(
{ name: issueName, description: issueDescription, description_html: issueDescriptionHTML },
2000
);
const stringFromValues = JSON.stringify(formValues);
useEffect(() => {
handleSubmit(formValues);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [handleSubmit, stringFromValues]);
return (
setIssueName(e.target.value)}
mode="transparent"
className="text-xl font-medium"
required={true}
/>
setIssueDescription(json)}
onHTMLChange={(html) => setIssueDescriptionHTML(html)}
/>
);
};