You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Submit the form and see that it doesn't work without throwing any error
Expected behavior
It throws a better error message than mutableImplStore.onSubmit is not a function in the onSubmitFailure function so I know I'm using the hook from react and not remix wrongly.
It will be nicer if the react hook detects when there is not a context and throws an error right away.
Screenshots or Videos
No response
Platform
Irrelevant
Additional context
I'm using Webstorm. As every developer that uses Intellij, I'm using the auto imports functionality. Because @rvf/react is always installed with RVF, it is likely that the useForm hook is not imported from @rvf/remix. Another error source is copying the example in the docs without paying attention to that. The issue is then difficult to find.
It would be nice to have also a section in the docs about debugging. I couldn't find easily the onSubmitFailure function. Without that, I couldn't find the error because the form was not submitting without any error.
The text was updated successfully, but these errors were encountered:
I think a section in the docs on debugging makes a lot of sense!
Part of the problem here is that we allow handleSubmit to be omitted when submitSource: "dom", but then we're not actually supporting that case unless you specify reloadDocument: true. It's intended that this should perform a native form submission if you don't specify handleSubmit, so that's the fix we need to implement.
If we do that, now I'm wondering if reloadDocument even makes sense as an option in the core library. That could be an API that's only supported by the Remix adapter.
Which packages are impacted?
@rvf/react
@rvf/remix
@rvf/zod
@rvf/yup
zod-form-data
What version of these packages are you using?
"@rvf/remix": "^6.3.0",
Please provide a link to a minimal reproduction of the issue.
https://stackblitz.com/edit/remix-run-remix-xdhnnj?file=app%2Froutes%2F_index.tsx
Steps to Reproduce the Bug or Issue
Expected behavior
It throws a better error message than
mutableImplStore.onSubmit is not a function
in theonSubmitFailure
function so I know I'm using the hook from react and not remix wrongly.It will be nicer if the react hook detects when there is not a context and throws an error right away.
Screenshots or Videos
No response
Platform
Irrelevant
Additional context
I'm using Webstorm. As every developer that uses Intellij, I'm using the auto imports functionality. Because
@rvf/react
is always installed withRVF
, it is likely that theuseForm
hook is not imported from@rvf/remix
. Another error source is copying the example in the docs without paying attention to that. The issue is then difficult to find.It would be nice to have also a section in the docs about debugging. I couldn't find easily the
onSubmitFailure
function. Without that, I couldn't find the error because the form was not submitting without any error.The text was updated successfully, but these errors were encountered: