Mis-Used Promise ESLINT
Anyone know how to correct this without telling Eslint to ignore?
<form
// eslint-disable-next-line @typescript-eslint/no-misused-promises
onSubmit={methods.handleSubmit(async (values) => {
await mutation.mutateAsync(values);
methods.reset();
})}
className="space-y-2"
>
I can't tell the
onSubmit
that handleSubmit
is void because then the validation doesn't take place.3 Replies
Maybe try to extract the method before that and type it out?
Well handle the promise properly then
catch
this or onClick={() => void functionWithPromise()}