Replies: 1 comment 4 replies
-
This is a limitation of the current naming conventions we used as there is no way we can know the form data entry is an array until I see the second entry with the same name. This is why your payload might look like this if there is only one item selected. Whereas value likely used the information from the zod schema to coerce it to an array automatically. I have thought about supporting an array notation for this case, e.g. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I would like to know why is conform serializing context.payload in the reply() function, as detailed here
I found this when my application told me that a html
<select>
element should have a defaultValue as an array if it is of typemultiple
.So I found there is a difference between :
payload: { foo: [ 'not_processed', 'wait_processing' ], bar: '1' }
value: { foo: [ 'not_processed', 'wait_processing' ], bar: [ 1 ] }
After this, the initialValue of my form will be the serialized version of payload, so my number[] becomes number.
@edmundhung Could you quickly explain the difference and the choice you've made here ? Thank you in advance !
Beta Was this translation helpful? Give feedback.
All reactions