🍨 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