Skip to content

react-hook-form 7.34.0

[7.34.0] - 2022-7-28

Added

  • Build in validation support for useFieldArray with rules prop
useFieldArray({
  name: 'test',
  rules: {
    required: true,
    minLength: 2,
    maxLength: 10,
    validate: (fieldArrayValues) => {
      if (fieldArrayValues[2].title === 'test') {
        return 'validate Error';
      }
    },
  },
});

errors?.test?.root?.message; // access root level errors