github react-hook-form/react-hook-form v7.17.0
Version 7.17.0

latest releases: v7.53.2, v7.53.1, v7.53.0...
3 years ago

✨ Add support for generic components using FieldPathWithValue (#6562)

type ExpectedType = { test: string };

const Generic = <FormValues extends FieldValues>({
  name,
  control,
}: {
  name: FieldPathWithValue<FormValues, ExpectedType>;
  control: Control<FormValues>;
}) => {
  const {
    field: { value, ...fieldProps },
  } = useController<FormValues, ExpectedType>({
    name,
    control,
    defaultValue: { test: 'value' },
  });

  return <input type="text" value={value.test} {...fieldProps} />;
};

⚙️ migrate from Select.options to Select.selectedOptions (#6678) (#6687)
🐞 fix #6683 trigger regression with isValid subscription (#6686)

Thanks to @julienfouilhe and @krnlde

Don't miss a new react-hook-form release

NewReleases is sending notifications on new releases.