Skip to content
Discussion options

You must be logged in to vote

You're using a "flat array" which is not supported by RHF.

You need to provide a field name for the array instead.

useForm({
- defaultValues: defaultSubscribes
+ defaultValues: {
+  subscribers: defaultSubscribes
+ }
})

<CheckboxNg
- name={`${index}.email`}
+ name={`subscribers.${index}.email`}
  control={control}
/>

Here's a working codesandbox.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@andrconstruction
Comment options

Comment options

You must be logged in to vote
1 reply
@andrconstruction
Comment options

Answer selected by andrconstruction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants