I mean, the react-hook-formhandleSubmit handler seems not to require a FormEvent (well, at least it's what it seems looking this interface
Also, if we use straight the react-hook-form:
import {useForm} from 'react-hook-form'
//.... using the hook
const reactForm = useForm({
resolver: async (data) => {
return {
values: data,
errors: {},
};
},
});
// calling the factory to handle the handleSubmit
const actualHandleSubmit = reactForm.handleSubmit(console.log, console.log);
// form event is optional
actualHandleSubmit()
We can call the actualHandleSubmit without passing any event.
I'm raising this issue because I've built forms out of the <Form> logic (within modals, lifting the remixForm up, etc) where I was simply calling methods.handleSubmit and the action trigger had happened inside the onValid hook where I massage the data and use the fetcher.
In summary, my question here is simple: is the event really required? If I pass an empty object would impact anyhow in the code?
Hey peeps. 👋
First, thanks for this library.
I'm trying to to migrate from
remix-hook-form
4 to 5 and I notice now, thehandleSubmit
handler we get fromuseRemixForm
requires a FormEvent.I found the commit that had implemented that (https://github.com/forge42dev/remix-hook-form/commit/63f34aaa70e193668040acb97fd6cdf7a81de271) saying
The one where remix-hook-form respects Form props
, but... is that true?I mean, the
react-hook-form
handleSubmit
handler seems not to require a FormEvent (well, at least it's what it seems looking this interfaceAlso, if we use straight the
react-hook-form
:We can call the
actualHandleSubmit
without passing any event.I'm raising this issue because I've built forms out of the
<Form>
logic (within modals, lifting the remixForm up, etc) where I was simply callingmethods.handleSubmit
and the action trigger had happened inside theonValid
hook where I massage the data and use the fetcher.In summary, my question here is simple: is the event really required? If I pass an empty object would impact anyhow in the code?