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

latest releases: 7.52.0, 7.51.5, 7.51.4...
19 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.