npm react-hook-form 7.40.0-next.1
Version 7.40.0-next.1

latest releases: 7.53.2, 7.53.1, 7.53.0...
24 months ago

👍 Improved async defaultValues inference

const fetchData = async () => {
  await sleep(1000)
  return {
    data: 'test'
  }
}

- useForm<Awaited<ReturnTypeof<typeof fetchData>>>({
+ useForm({
  defaultValues: fetchData, // will infer the promise return type
})

👍 Improved useForm resetOptions to keep track of dirty input

- const { formState: { dirtyFields } } = useForm({
+ useForm({ // dirtyFields subscription is no longer required
  values,
  resetOptions: {
    keepDirtyValues; true, // only non dirty input will receive data from the values update
  }
})

ðŸŠķ improve useFormContext perf by avoiding reference re-create with omit
ðŸĶ close #9410 improve UX when subscribing to both isValid and errors state (#9413)

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

NewReleases is sending notifications on new releases.