Replies: 2 comments 3 replies
-
Conform does some work to convert common Javascript values to the corresponding HTML Input values. You can see some of the work here. This is a nice feature! You don't have to convert Here's a simplified version of your sandbox that populates the values as expected. I made a couple of adjustments:
|
Beta Was this translation helpful? Give feedback.
-
Looks like there are some issues on the type inference. But all the default value is populated as expected. Conform handle all the value in the serialized format. This includes serializing the default value, like a boolean will become With regards to the update, the value you are updating to will be serialized with the same rules. But I probably forgot to include this logic, so it end up broken in your example. I will fix it tonight. The input type should be the HTML Input type as @aust1nz shared. |
Beta Was this translation helpful? Give feedback.
-
I am trying to create a Form based on this zod schema :
and initialize it with some defaultValues. However, as you can see in this sandbox, not all the fields are populated, and I have some Typescript errors with the use of getInputProps.
Moreover, when I update the fields individually, it does work with
string
values only, and fail withnumber
andboolean
, even if these values are accepted in the inputOptions.Do I have to change the way of treating with these type of values ? Is it something related to my use of zod ?
Thank you in advance for any recommendation :)
Beta Was this translation helpful? Give feedback.
All reactions