Skip to content
Discussion options

You must be logged in to vote

Currently, the radio input is not controlled.

What the document recommends in the useFieldArray():

Each input name needs to be unique, if you need to build checkbox or radio with the same name then use it with useController or Controller.

Eventually, you may need to create the controlled radio / radio group component with useController or Controller.

e.g) codesandbox

const RadioButtonGroup = ({
  control,
  index: number,
}: {
  control: UseForm["control"];
  index: number;
}) => {
  const { field } = useController({
    control,
    name: `test.${number}.radioEx`,
    rules: {
      required: true,
    },
  });
  const { value, name, ...methods } = field;

  return (
    <div>
      <p 

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@douglasrcjames
Comment options

@sujinleeme
Comment options

Answer selected by douglasrcjames
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants