defaultValue is array #629
Closed
jamalsoueidan
started this conversation in
General
Replies: 1 comment 1 reply
-
Conform do not support array at the root level. You need to wrap the array in an object, like this: const [form, fields] = useForm({
defaultValue: {
// You can name it anything, e.g. `list`
list: option.variants.map((v) => ({
id: v.variantId.toString(),
price: v.price,
duration: v.duration.value.toString(),
})),
}
});
// You can nw access the list with `fields.list.getFieldList()`. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an array
I cannot do fields..getFieldList or fields.map???
Beta Was this translation helpful? Give feedback.
All reactions