⚡️ createFormControl
- Allow us to start subscribing outside of the React component
const { formControl, control } = createFormControl(props)
function App() {
const { register } = useForm({
formControl,
})
return <form />
}
function Test() {
useFormState({
control // no longer need context api
})
}
⚡️ subscribe
- subscribe form state update without re-render
- subscribe outside of the react component
const { formControl } = createFormControl(props)
formControl.subscribe({
formState: { isDirty: true },
callback: (formState) => {
if (formState.isDirty) {
// do something here
}
}
})
function App() {
const { register } = useForm({
formControl,
})
return <form />
}
🪲 fix https://github.com/react-hook-form/react-hook-form/issues/12680: Update Fieldarray Unmount Status (https://github.com/react-hook-form/react-hook-form/pull/12690) 🫡 fix: improve type inference for useFormContext (https://github.com/react-hook-form/react-hook-form/pull/12689) 👮♂️ feat: infer resolver output types (https://github.com/react-hook-form/react-hook-form/pull/12638) 🐞 fix(useForm): make values and defaultValues work correctly with createFormControl and useMemo (https://github.com/react-hook-form/react-hook-form/pull/12675) 🥹 close https://github.com/react-hook-form/react-hook-form/issues/12665 issue with values not populate form 🐞 fix https://github.com/react-hook-form/react-hook-form/issues/12665 regression on values over take default values 🫡 allow use of handleSubmit with native events (https://github.com/react-hook-form/react-hook-form/pull/12645) 🐞 fix https://github.com/react-hook-form/react-hook-form/issues/12631 revalidateMode issue with useFieldArray validation (https://github.com/react-hook-form/react-hook-form/pull/12646) 🦥 close allow components with useController hook be memoized () 🐞 fix setError in useEffect does not work when used inside the FormProvider context () 🛟 fix: add the condition to prevent infinite render with errors prop () 🐞 fix valid state update with onBlur mode () 🐞 fix disabled field value not get undefined in resolver () 🦾 feat: reference stable for useWatch defaultValue () ⏰ chore: remove typetest folder from build () 🐞 fix useController should unregister issue with strict mode () 👁️ feat: improve reference update with useWatch () 🦥 close disabled state issue with touched and dirty ()