Repository navigation
Minor Changes
-
a79961e: New options and fixes for
useRemixForm:- New
defaultSubmitHandleron the hook return. It is the handler thatuseRemixFormuses whensubmitHandlers.onValidis not set. Call it in a customonValidto submit to the action in the default way. The form action, method and encType still apply (#148). - New
submitRawValuesoption. When it istrue, the default submit handler sendsgetValues()and not the resolver output, so transforms (for example a zod.transform()) do not run on the client and again on the server (#172). - New
resetOnSuccessoption. When it istrue, the form is reset after a submission if the action returns noerrors(#157). - The return types of
useRemixFormanduseRemixFormContextnow come fromUseFormReturn. Members that new react-hook-form versions add (for examplegetErrorsandresetDefaultValues) are typed, and<RemixFormProvider {...form}>compiles again with react-hook-form 7.82 and later (#185).UseRemixFormReturn["handleSubmit"]now has only the event signature that the hook uses. - A form with an input named
action,methodorenctypenow submits correctly (#139). - A router
basenamewith a trailing slash (/app/) no longer makes the form action a relative path (#175). - An array or
FileListwith one file now parses back as an array on the server (#178).
- New