-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to Use Form's method. action, and encType. #132
Comments
Can you create a minimum repro? I just tested out the form inheritance and it indeed does inherit from the form action and encType and method |
I'm also running into this with fetchers on I get this error when clicking submit on the form:
Uncomment the |
In my situation, my projected relied on version "5.1.1" to handle non "react-router" remix apps. In that version, there seems to be a problem with handling the properties from the dom. However, I've been migrating our app to react-router v7 with a newer version of remix-hook-form, and the issue is not relevant anymore. Still, if compatibility is a must, perhaps a bugfix might be recommended. |
Hey,
I've been attempting to use Form's props to set up the action and method, but they always default to method="GET" and action="."
I've attempted to make it work with handleSubmit, but it seems that whenever handleSubmit is assigned to onSubmit, it does not work. However, when onSubmit is not defined, it seems to work. This issue seems to be related to the handleSubmit provided by useRemixForm.
After going through the test cases in the repo, particularly this, seems that submitConfig can be used to specify the action, method, and encType. After trying it, it works as expected.
As such, the expected behaviour of defining the action and method in the Form component while also assigning handleSubmit to its onSubmit prop does not work. Although I had problems with react router v7, it seems not to be the problem since the submitConfig attribute in useRemixForm make the Form work as intended.
I'm unsure if I'm missing any particular caveat, but let me know if this is an issue.
The text was updated successfully, but these errors were encountered: