Skip to content

react-hook-form 7.41.0

[7.41.0] - 2022-12-17

Added

  • useForm added values props
const values = await fetch('API');

useForm({
  values, // will reset the form when values updates
  // resetOptions: {
  //   keepDirtyValues: true
  // }
});
  • new isLoading formState for async defaultValues
const {
  formState: { isLoading },
} = useForm();

Changed

  • useForm support async defaultValues props
const {
  formState: { isLoading },
} = useForm({
  defaultValues: fetch('API'),
  // resetOptions: {
  //   keepDirtyValues: true
  // }
});