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
constdataRequestSchema=z.object({// A pure HTML Input with multiple files would have type 'FileList'// But our usage of react-dropzone + react-hook-form controller sends an array of Filefiles: z.array(z.instanceof(File)),comments: z.string().nullable(),})
The files param is not mapped correctly like it should in the FormData (Chrome request window) - it is serialized as an array of strings:
--
I had to define a custom submitHandler
constform=useRemixForm<DataRequest>({resolver: zodResolver(dataRequestSchema),submitHandlers: {onValid: (data)=>{constformData=newFormData()// Send a File[] called 'files'for(constfileofdata.files){formData.append('files',file)}
...
Not sure if the fix is complex =)
The text was updated successfully, but these errors were encountered:
Hi,
Version:
4.3.0
but also5.1.0
Symptom
When using the
useRemixForm<>()
naivelyUsing this schema:
The files param is not mapped correctly like it should in the
FormData
(Chrome request window) - it is serialized as an array of strings:--
I had to define a custom
submitHandler
Not sure if the fix is complex =)
The text was updated successfully, but these errors were encountered: