undefined fields return as "undefined" string after getValidatedFormData
#83
Replies: 2 comments 4 replies
-
@peternguyen777 I believe I can answer that... my understanding is that remix-hook-form basically stringifies everything by default when it sends data back to the server. Then on the server side... zod will cast back to the value types you defined them as... so in your case like this: const {
handleSubmit,
formState: {errors, isSubmitting},
register,
setValue
} = useRemixForm<FormData>({
mode: "onSubmit",
resolver,
stringifyAllValues: false
}) |
Beta Was this translation helpful? Give feedback.
-
I'm dealing with empty/ Would prefer removing all empty/ Also, |
Beta Was this translation helpful? Give feedback.
-
I have the following schema, however after validation, why is
data.id
coming out as a string called"undefined"
rather thanundefined
?Beta Was this translation helpful? Give feedback.
All reactions