npm react-hook-form 7.37.0-next.0
Version 7.37.0-next.0

latest releases: 7.53.2, 7.53.1, 7.53.0...
2 years ago

🍨 feature: include defaultValues inside formState (#8966)

const { formState, watch } = useForm({
  defaultValues: { name: 'test' }
})
const { defaultValues } = useFormState()

const name = watch('name')

return (
  <div>
    <p>Your name was {defaultValues.name}</p>
    <p>Updated name is {name}</p>
  </div>
)

😵‍💫 close #9105 improve input focus method check (#9109)
🖨 close #9058 avoid clone object when contains prototype methods

class DataModel {
  constructor() {
    this.firstName = null
  }
}
const formData = new DataModel({ firstName: "Bob" })

useForm({
  defaultValues: formData // no longer get clone internally
})

📖 fix UseFieldArrayAppend types example (#9093)

thanks to @arieloO

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

NewReleases is sending notifications on new releases.