Closed themse closed 6 months ago
I truly appreciate all the tremendous work you have done for us. Thank you very much, and I apologize for any inconvenience or disturbance caused.
If someone has watched the video and also encountered this issue, here is the solution that I found in Jack's another repository.
briefly
onSubmit={(evt) => {
evt.preventDefault();
form.handleSubmit(() => {
formAction(new FormData(formRef.current!));
})(evt);
}}
instead of
onSubmit={form.handleSubmit(() => formRef?.current?.submit())}
Nice! That's actually good fix for the useFormStatus
issue that folks are running into.
@jherr I can create PR if it's necessary
I'm never one to refuse a good PR, believe me.
Issue Title: Error: Form Submit
Description: After adding the
useFormState
hook and switching to manual form submission usingformRef
, I encountered issues with the functionality: time to time, I get the error (attached screenshot)Expected Behavior: We can workaround it using client and react-hook-form in such way:
But your version is elegant and much better.
Actual Behavior: Screenshot with error attached. It happens here
Link to place in repo https://github.com/ProNextJS/forms-management/blob/main/src/app/RegistrationForm.tsx#L95C8-L95C71 Recommendations in Error stack trace also don't work :(
Have you come across such issue?
Screenshots (if applicable):
Additional Information: Operating System: macOS Sonoma 14.4.1 Browser/Software Version: Google Chrome Version 123.0.6312.87