Repository: react-hook-form/react-hook-form
File: src/useForm.ts (TypeScript)

Code before:
    (isArray(name) ? name : [name]).forEach((fieldName) =>
      removeFieldEventListenerAndRef(fieldsRef.current[fieldName], true),
    );
  }

  function registerFieldRef<TFieldElement extends FieldElement<TFieldValues>>(
    ref: TFieldElement & Ref,
    validateOptions: ValidationRules | null = {},
  ): ((name: InternalFieldName<TFieldValues>) => void) | void {
    if (process.env.NODE_ENV !== 'production' && !ref.name) {
      // eslint-disable-next-line no-console
      return console.warn('Missing name @', ref);
    }

    if (
      process.env.NODE_ENV !== 'production' &&
      fieldArrayNamesRef.current.has(stringToPath(ref.name)[0] as string) &&
      !RegExp(
        `^${stringToPath(ref.name)[0] as string}[\\d+]\.\\w+`
          .replace(/\[/g, '\\[')
          .replace(/\]/g, '\\]'),
      ).test(ref.name)
    ) {
      // eslint-disable-next-line no-console
      return console.warn(
        "Make sure name is in object shape: name=test[index].name as we don't support flat arrays. Please see https://react-hook-form.com/api#useFieldArray",
      );
    }

    const { name, type, value } = ref;
    const fieldRefAndValidationOptions = {
      ref,
      ...validateOptions,
    };
    const fields = fieldsRef.current;
    const isRadioOrCheckbox = isRadioOrCheckboxFunction(ref);
    let field = fields[name] as Field;
    let isEmptyDefaultValue = true;
    let isFieldArray;
    let defaultValue;

    if (
      field &&
      (isRadioOrCheckbox
        ? isArray(field.options) &&
          unique(field.options).find((option) => {
            return value === option.ref.value && option.ref === ref;
          })
        : ref === field.ref)
    ) {
      fields[name] = {

Review comment (suggestion):
```suggestion
        "Name should be in object shape: name="test[index].name". https://react-hook-form.com/api#useFieldArray",
```

Code after:
    (isArray(name) ? name : [name]).forEach((fieldName) =>
      removeFieldEventListenerAndRef(fieldsRef.current[fieldName], true),
    );
  }

  function registerFieldRef<TFieldElement extends FieldElement<TFieldValues>>(
    ref: TFieldElement & Ref,
    validateOptions: ValidationRules | null = {},
  ): ((name: InternalFieldName<TFieldValues>) => void) | void {
    if (process.env.NODE_ENV !== 'production' && !ref.name) {
      // eslint-disable-next-line no-console
      return console.warn('Missing name @', ref);
    }

    if (
      process.env.NODE_ENV !== 'production' &&
      fieldArrayNamesRef.current.has(stringToPath(ref.name)[0] as string) &&
      !RegExp(
        `^${stringToPath(ref.name)[0] as string}[\\d+]\.\\w+`
          .replace(/\[/g, '\\[')
          .replace(/\]/g, '\\]'),
      ).test(ref.name)
    ) {
      // eslint-disable-next-line no-console
      return console.warn(
        'Name should be in object shape: name="test[index].name". https://react-hook-form.com/api#useFieldArray',
      );
    }

    const { name, type, value } = ref;
    const fieldRefAndValidationOptions = {
      ref,
      ...validateOptions,
    };
    const fields = fieldsRef.current;
    const isRadioOrCheckbox = isRadioOrCheckboxFunction(ref);
    let field = fields[name] as Field;
    let isEmptyDefaultValue = true;
    let isFieldArray;
    let defaultValue;

    if (
      field &&
      (isRadioOrCheckbox
        ? isArray(field.options) &&
          unique(field.options).find((option) => {
            return value === option.ref.value && option.ref === ref;
          })
        : ref === field.ref)
    ) {
      fields[name] = {