๐ react-hook-form/react-hook-form - Release Notes
Version 7.55.0 (2025-03-28)
โก๏ธ `createFormControl`
- Allow us to start subscribing outside of the React component
```tsx
const { formControl, control } = createFormControl(props)
function App() {
const { register } = useForm({
formControl,
})
return
}
function Test() {
useFormState({
control // no longer need context api
})
}
```
โก๏ธ `subscribe`
- subscribe form state update without re-render
- subscribe outside of the react component
```tsx
const { formControl } = createFormControl(props)
formControl.subscribe({
formState: { isDirty: true },
callback: (formState) => {
if (formState.isDirty) {
// do something here
}
}
})
function App() {
const { register } = useForm({
formControl,
})
return
}
```
๐ชฒ 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 https://github.com/react-hook-form/react-hook-form/issues/12634 allow components with useController hook be memoized (https://github.com/react-hook-form/react-hook-form/pull/12635)
๐ fix https://github.com/react-hook-form/react-hook-form/issues/12580 setError in useEffect does not work when used inside the FormProvider context (https://github.com/react-hook-form/react-hook-form/pull/12642)
๐ fix: add the condition to prevent infinite render with errors prop (https://github.com/react-hook-form/react-hook-form/pull/12622)
๐ fix https://github.com/react-hook-form/react-hook-form/issues/12580 valid state update with onBlur mode (https://github.com/react-hook-form/react-hook-form/pull/12612)
๐ fix https://github.com/react-hook-form/react-hook-form/issues/12572 disabled field value not get undefined in resolver (https://github.com/react-hook-form/react-hook-form/pull/12573)
๐ฆพ feat: reference stable for useWatch defaultValue (https://github.com/react-hook-form/react-hook-form/pull/12564)
โฐ chore: remove typetest folder from build (https://github.com/react-hook-form/react-hook-form/pull/12555)
๐ fix https://github.com/react-hook-form/react-hook-form/issues/12532 useController should unregister issue with strict mode (https://github.com/react-hook-form/react-hook-form/pull/12538)
๐๏ธ feat: improve reference update with useWatch (https://github.com/react-hook-form/react-hook-form/pull/12537)
๐ฆฅ close https://github.com/react-hook-form/react-hook-form/issues/12531 disabled state issue with touched and dirty (https://github.com/react-hook-form/react-hook-form/pull/12536)
thanks to @jtomaszewski, @joshkel, @candymask0712, @kotarella1110, @jorisre, @jtomaszewski, @controversial and @jedahu
Version 7.55.0-next.9 (2025-03-17)
๐ชฒ fix #12680: Update Fieldarray Unmount Status (#12690)
๐ซก fix: improve type inference for useFormContext (#12689)
thanks to @jorisre & @DavidIMk
Version 7.55.0-next.8 (2025-03-13)
๐ฎโโ๏ธ feat: infer resolver output types (#12638)
๐ fix(useForm): make values and defaultValues work correctly with createFormControl and useMemo (#12675)
๐ฅน close #12665 issue with values not populate form
thanks @kotarella1110, @jorisre, @jtomaszewski, @controversial and @jedahu
Version 7.55.0-next.7 (2025-03-07)
๐ fix #12665 regression on values over take default values
Version 7.55.0-next.6 (2025-03-05)
๐ซก allow use of handleSubmit with native events (#12645)
๐ fix #12631 revalidateMode issue with useFieldArray validation (#12646)
๐ฆฅ close #12634 allow components with `useController` hook be memoized (#12635)
๐ fix #12580 `setError` in `useEffect` does not work when used inside the FormProvider context (#12642)
thanks to @jtomaszewski, @joshkel, @candymask0712 & @kotarella1110
Version 7.55.0-next.5 (2025-02-22)
๐ fix: add the condition to prevent infinite render with `errors` prop (#12622)
๐ fix #12580 valid state update with `onBlur` mode (#12612)
Version 7.55.0-next.4 (2025-02-08)
๐ fix #12572 disabled field value not get undefined in resolver (#12573)
๐ฆพ feat: reference stable for useWatch defaultValue (#12564)
โฐ chore: remove __typetest__ folder from build (#12555)
Version 7.55.0-next.3 (2025-01-25)
๐ fix #12532 `useController` should unregister issue with strict mode (#12538)
๐๏ธ feat: improve reference update with `useWatch` (#12537)
Version 7.55.0-next.2 (2025-01-18)
๐ฆฅ close #12531 disabled state issue with touched and dirty (#12536)
Version 7.55.0-next.1 (2024-12-27)
๐ฅฒ fix incorrect type for `useForm` with `formControl`
```diff
const { formControl, control } = createFormControl(props)
function App() {
const { register } = useForm({
- control,
+ formControl,
})
return
}
```
๐ Version7.55.0-next.0 (2024-12-24)
โก๏ธ `createFormControl`
- Allow us to start subscribing outside of the react component
```tsx
const { formControl, control } = createFormControl(props)
function App() {
const { register } = useForm({
formControl,
})
return
}
function Test() {
useFormState({
control // no longer need context api
})
}
```
โก๏ธ `subscribe`
- subscribe form state update without re-render
- subscribe outside of the react component
```tsx
const { formControl } = createFormControl(props)
formControl.subscribe({
formState: { isDirty: true },
callback: (formState) => {
if (formState.isDirty) {
// do something here
}
}
})
function App() {
const { register } = useForm({
formControl,
})
return
}
```
Version 7.54.2 (2024-12-20)
โ๏ธ fix #12478 issue should unregister input with controller (#12480)
โฐ close #12443 track disabled fields and only omit data on submit (#12491)
โ๏ธ upgrade e2e automation app to react 19 (#12482)
๐งช test(useWatch): destructure setValue from useForm
Thanks very much, @marcalexiei for your contribution to the documentation!
Version 7.54.1 (2024-12-12)
Revert "๐ฆฅ fix: useForm should return a new object on formState changes (#12424)" (#12475)
Version 7.54.0 (2024-12-06)
๐ฆฅ fix: useForm should return a new object on formState changes (#12424)
๐งป improve prototype pollution check (#12431)
๐ช fix: add FileList availability check for environments without FileList support (#12332)
๐งช close #12198 memo for useController and useFormState (#12421)
๐ fix #12407 useFieldArray append issue with useForm disabled props (#12420)
๐ fix #12415 issue with flatten object with null value (#12418)
๐ fix #12385 nested array field invalid validation report on removed (#12405)
๐ fix: hasPromiseValidation return true or false appropriately. (#12389)
๐ fix more staled props (#12404)
thanks to @developer-bandi, @OlegDev1, @sukvvon, @alexandredev3 and @mfazekas
Version 7.53.2 (2024-11-08)
๐ fix #12398 staled disabled issue with resubmit form (#12403)
๐ fix: add type guard to fieldRef.select (#12390)
Revert "๐บ watch reference update on formState update (#12326)" (#12391)
thanks to @developer-bandi
Version 7.53.1 (2024-10-19)
๐ fix: #12294 ensure Invalid Date is evaluated correctly (#12295)
๐ fix #12316 setValue should work for arrays of primitives to handle checkboxes (#12316) (#12317)
๐ fix #12097 Use dirty fields along with mount names for form reset with keepDirtyValues (#12211)
๐ซ fix #12237 disabled state trigger formState dirty/dirtyFields to update (#12239)
๐ fix #12291 field array remove cause undefined with FormData (#12305)
๐ improve flatten function with object type check (#12306)
๐๏ธ improve: resolve type of set function (#12145)
๐ง chore: upgrade eslint to v9 (#12150)
๐ fix: code example input field placeholder name (#12296)
๐ docs: fix typo in code example (#12271)
thanks to @rasikhq @abnud11 @crypt0box @developer-bandi @matmannion @hasancruk & @vismay7
Version 7.53.0 (2024-08-24)
๐ซ๏ธ feat: #12148 support isValid when mode is set to onBlur (#12194)
```tsx
// update formstate isValid with onBlur event
const { formState: { isValid } } = useForm({
mode: 'onBlur'
})
```
๐ fix #12021 issue with disable prop not reflecting on re-render without trigger by useEffect (#12193)
๐ฉโ๐พ close #12168 optimise re-render with validating fields subscription (#12192)
๐ fix #12127 issue with compare object value changed with object input (#12185)
๐ฒ improve : break out of recursive loops on first focus (#11827)
๐ fix example of ObjectKeys type (#11965)
thanks to @suke & @DPflasterer
Version 7.52.2 (2024-08-03)
๐ close #12108 useController should subscribe to exact field name of form's state (#12109)
๐ chore: upgrade app deps
๐ฉป fix: add useCallback for ref callback (#12078)
๐ fix: skip call executeBuiltInValidation if no sub-fields left (#12054)
thanks to @newsiberian, @Wendystraite and @abnud11
Version 7.52.1 (2024-07-02)
๐ fix #12024 dirty not update issue with values prop (#12041)
๐ fix: field array validate rules shift errors (#12033)
thanks to @JardelCheung
Version 7.52.0 (2024-06-15)
โ๏ธ close #11932 enable react 19 peer dependency (#11935)
๐ฎโโ๏ธ close #11954 getFieldState remove unnessaried inValidating and touched subscription (#11995)
๐ fix #11985 logic createFormControl check field before usage (#11986)
โจ๏ธ fix: enforce type safety for deps property in RegisterOptions (#11969)
๐ fix #11922 keep dirty on reset with dirty fields (#11958)
๐ close #11937 add validation in the cleanup process in useController (#11938)
Revert "โจ๏ธ close: correct type of error field in getFieldState return object (#11831)"
๐ fix: change info.values type in WatchObserver (#11917)
thanks to @nakaakist, @IdoBouskila, @pincy and @peinguin
Version 7.51.5 (2024-05-21)
๐ fix broken link to examples in README.md (#11805)
โจ๏ธ close: correct type of error field in getFieldState return object (#11831)
๐ fix #11842 radio buttons not disabled when multiple share a name (#11873)
๐ fix #11821 set value with disabled false before mount (#11880)
๐ fix setError to preserve existing errors elsewhere in the object (#11888)
โจ๏ธ fix: add info.value type to WatchObserver (#11872)
๐ซก fix issue with internal `set` api (#11915)
thanks to @mjr2595 @erashu212 @SimonJTurner and @peinguin
Version 7.51.4 (2024-05-04)
๐น close #11778 improve unregister omit key with getValues method (#11779)
๐ fix #11794 issue: Fields dirty state is not updated when passing values to useForm
Version 7.51.3 (2024-04-11)
๐ fix #11773 regression on dirty check with reset (#11775)
Version 7.51.2 (2024-03-26)
๐ fix #11719 validation stuck on true state (#11723)
Version 7.51.1 (2024-03-17)
๐ bug(validatingFields, trigger): handle all fields validation trigger (#11624)
๐ ci: cleanup actions versions (#11629)
๐ fix #11590 issue with trigger on validatingFields (#11613)
thanks to @Moshyfawn
Version 7.51.0 (2024-03-01)
๐ฌ add `isValidating` and `validatingFields` to field state (#10657)
```tsx
const { formState: { validatingFields } } = useForm({ mode: 'onBlur' });
```
โจ๏ธ chore: replace ts-ignore with ts-expect-error (#11573)
๐งโโ๏ธ chore: update lib dev deps (#11548)
๐
related #11541 improve dirty check when undefined provided with reset api
๐พ fix #11514 issue under strict mode reset invoke twice reset mounted field names with keepDirtyValues (#11546)
๐คก fix flush root render hack (#11521)
๐งฝ chore: removed unused utils and resp. test cases (#11476)
๐ close #11503 issue dirty field update with async validation (#11509)
Revert "๐ง fix data param in handleSubmit when TTransformedValues is a union type (#11420)"
Revert "โจ feat(values): priorities values over defaultvalues (#11399)" (#11545)
โค๏ธ Thanks to @deepgolani4, @pbankonier and @deepgolani4
โค๏ธ Thank you principal.com for your contribution
Version v7.50.1 (2024-02-06)
๐ฅฒ Regression: Revert "โจ๏ธ fix #10734 watch and useWatch without parameters return type (#11359)"
Versions 7.50.0 (2024-02-01)
๐ง fix data param in handleSubmit when TTransformedValues is a union type (#11420)
๐ท build(Engines): remove pnpm dependency (#11425)
๐ fixes #11386 get new dirtyFields when reset keeping defaults and dirty values (#11401)
๐ท๏ธ improve CustomElement type (#11309)
๐ซ feat(useForm): leave formState flags in a consistent state when throwing in handleSubmit onValid (#11214)
โจ๏ธ fix: change DeepPartial to account for object union types & unknown (#11385)
โจ feat(values): priorities values over defaultvalues (#11399)
๐ close #11246 skip root validation on action when mode and revalidate mode is onSubmit (#11395)
๐ฉ fix #11322 trigger extra re-render with useWatch plus shouldUnregister (#11394)
โจ๏ธ fix #10734 watch and useWatch without parameters return type (#11359)
๐งโโ๏ธ fix #11281 issue with upgrade node version (#11392)
๐ fix #11368 keep form state mounted when keeping values (#11384)
๐ fix #11374: Nested deep partial with unknown (#11373)
thanks to @Moshyfawn, @jonahallibone, @eladattias1996, @RulerOfCakes, @anonkey, @Ar4ys, @IanVS and @r-kataoka11
Version 7.49.3 (2024-01-08)
๐ fix(formState, disabled): infer controlled disabled form state (#11361)
๐ fix(reset): remove global reset option flag (#11355)
๐ fix(useController): check if disabled state was set by user (#11353)
๐จ๏ธ fix: Change DeepPartial type definition to be compatible with unknown (#11333)
๐ fix #11328 resetField with object as defaultValue (#11329)
thanks to @Moshyfawn, @geeee and @RulerOfCakes
Version 7.49.2 (2023-12-13)
๐ fix #11292 issue with controller validation prop (#11294)