🍨 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>
)
Screen.Recording.2022-10-07.at.8.55.56.am.mov
🖨 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 #9134 useFieldArray validation action inconsistency (#9136)
🥷 close #9126 useController ref overwrite under strict mode (#9130)
😵💫 close #9105 improve input focus method check (#9109)
📖 fix UseFieldArrayAppend types example (#9093)
🖇 change link (#9159)
🙌 improve naming of options forEach local (#9152)
thanks to @arieloO @Ilaygoldman and @simenbrekken-visma