) => {
handleFormSubmit({
name: formData.name ?? "",
description: formData.description,
description_html: formData.description_html,
});
},
[handleFormSubmit]
);
const debounceHandler = useMemo(
() => debounce(handleSubmit(handleDescriptionFormSubmit), 2000),
[handleSubmit, handleDescriptionFormSubmit]
);
useEffect(
() => () => {
debounceHandler.cancel();
},
[debounceHandler]
);
// reset form values
useEffect(() => {
if (!issue) return;
reset(issue);
}, [issue, reset]);
return (
{
setValue("name", e.target.value);
debounceHandler();
}}
mode="transparent"
className="text-xl font-medium"
required={true}
/>
{
setValue("description", json);
debounceHandler();
}}
onHTMLChange={(html) => setValue("description_html", html)}
/>
);
};