Delay between <form> onSubmit and react-form onSubmit callback called
When I add a console log to both the form's onSubmit callback, and the useForm hook's options onSubmit callback, I see there is a slight, but noticeable, delay between the two logs.
4 Replies
genetic-orange•2y ago
Can you help us debug this? I've been unable to figure out what the performance problem is because I can't reproduce it
compatible-crimsonOP•2y ago
Let me see if I can make a small demo.
What does the form hook do between calling
form.handleSubmit();
and when the useForm
onSubmit
callback is called?
Would it make a difference if the callback is async or not? I noticed it's an async func in the quick start example.
I wonder if it matters if no validation is defined. I noticed handleSubmit does some async stuff, like
before onSubmit
is called.genetic-orange•2y ago
Yeah but that should be empty
Like a micro tick at most
compatible-crimsonOP•2y ago
Yeah, that's what I'd expect.