onSubmit causing a `Error: Promise-returning function...` typescript error.
ralph-p opened this issue · 0 comments
ralph-p commented
documentation/src/content/docs/useform.mdx
Lines 464 to 469 in 981913b
This causes a Error: Promise-returning function provided to attribute where a void return was expected. @typescript-eslint/no-misused-promises
typescript error.
This change fixes the issue for me
const onSubmit = (data: IFormInput) => {
console.log(data)
};
return (
<form onSubmit={(event) => {
event.preventDefault();
void handleSubmit(onSubmit)(event);
}}>