useFieldArray two arrays and two inputs , remove , append e fields

Viewed 125

how can I add a new input to the second array, or remove an input, without interfering with the first array ?

  const {register , handleSubmit , control} = useForm({
       defaltValues:{
        teste1:[{name1:""}],
        teste2:[{nome2:""}]
    })
    
    const {fields , append , remove} = useFieldArray({
      control,
      name:"teste1",
      name:"teste2"
    })
0 Answers
Related