Closed vrn-hkz closed 7 months ago
@vrn-hkz this is the intended behavior, if you're interested in why this is done you can find a detailed explanation here: https://github.com/react-hook-form/react-hook-form/pull/11061#issuecomment-1866564244 I stringify it so I can preserve the original types and easily parse back to original values, you can use the "false" option to do that yourself obviously but then you would have to convert everything back manually, eg string number => number, string boolean => boolean
Ok thanks for the feeback!
Because of this line in
createFormData(data: T, stringifyAll = true)
in./utilities/index.ts
So when accessing FormData in backend with
formData.get('email')
the result is"/"x@x.com/""
with double quoted string. What can be the workaround for this?Currently I am setting
stringifyAllValues: false
and coercing all to strings in my zod schema.