NewYour coding agent can read the release notes before it upgrades.Set up the MCP server โ
npm, #750 most downloaded on npm
Performant, flexible and extensible forms library for React Hooks
Latest stable
7.91.0
Last release 27 days ago
23 Oct 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
1103 releases ยท first in 2019
Drag across the ruler to compare, or tap a release to open it.
โฐ feat: introduce isReady state for subscription
โฐ feat: introduce isReady state for subscription (#12568)
const { formState: { isReady }, setValue } = useForm()
useEffect(() => {
// form subscription setup is ready
if (isReady) setValue('test', 'value')
}, [isReady])
๐ feat: support reactive mode and reValidateMode (#12743) ๐ fix #12741 regression on move/swap on useFieldArray input update (#12749) ๐ fix: use useIsomorphicLayoutEffect to address warning in SSR (#12738)
mode and reValidateMode supportisReady state for subscriptionuseFieldArray input updateuseIsomorphicLayoutEffect to address SSR warningโฐ feat: introduce isReady state for subscription
โฐ feat: introduce isReady state for subscription (#12568)
const { formState: { isReady }, setValue } = useForm()
useEffect(() => {
// form subscription setup is ready
if (isReady) setValue('test', 'value')
}, [isReady])
๐ feat: support reactive mode and reValidateMode (#12743) ๐ fix #12741 regression on move/swap on useFieldArray input update (#12749) ๐ fix: use useIsomorphicLayoutEffect to address warning in SSR (#12738)
Your coding agent can read these notes before it upgrades. Set up the MCP server โ
Allow us to start subscribing outside of the React component
โก๏ธ createFormControl
const { formControl, control } = createFormControl(props)
function App() {
const { register } = useForm({
formControl,
})
return <form />
}
function Test() {
useFormState({
control // no longer need context api
})
}
โก๏ธ subscribe
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 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
createFormControl and subscribe functionuseController hook to be memoizeduseWatch defaultValuehandleSubmit with native events supportuseFormContextvalues and defaultValues work correctly with createFormControl and useMemoonBlur modedisabled field value not returned as undefined in resolverrevalidateMode issue with useFieldArray validationuseController unregister issue with strict modesetError in useEffect not working inside FormProvider contextuseController return props reference stability๐ชฒ fix #12680: Update Fieldarray Unmount Status (#12690) ๐ซก fix: improve type inference for useFormContext
๐ชฒ fix #12680: Update Fieldarray Unmount Status (#12690) ๐ซก fix: improve type inference for useFormContext (#12689)
thanks to @jorisre & @DavidIMk
๐ฎโโ๏ธ feat: infer resolver output types (#12638) ๐ fix(useForm): make values and defaultValues work correctly with createFormControl and useMemo (#1267
๐ฎโโ๏ธ 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
๐ fix #12665 regression on values over take default values
๐ fix #12665 regression on values over take default values
๐ซก allow use of handleSubmit with native events (#12645) ๐ fix #12631 revalidateMode issue with useFieldArray validation (#12646) ๐ฆฅ close #12634 allow
๐ซก 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
๐ fix: add the condition to prevent infinite render with errors prop (#12622) ๐ fix #12580 valid state update with onBlur mode
๐ fix: add the condition to prevent infinite render with errors prop (#12622)
๐ fix #12580 valid state update with onBlur mode (#12612)
๐ fix #12572 disabled field value not get undefined in resolver (#12573) ๐ฆพ feat: reference stable for useWatch defaultValue (#12564) โฐ chore: remove _
๐ 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)
๐ fix #12532 useController should unregister issue with strict mode (#12538) ๐๏ธ feat: improve reference update with useWatch
๐ fix #12532 useController should unregister issue with strict mode (#12538)
๐๏ธ feat: improve reference update with useWatch (#12537)
๐ฆฅ close #12531 disabled state issue with touched and dirty
๐ฆฅ close #12531 disabled state issue with touched and dirty (#12536)
๐ฅฒ fix incorrect type for useForm with formControl
๐ฅฒ fix incorrect type for useForm with formControl
const { formControl, control } = createFormControl(props)
function App() {
const { register } = useForm({
- control,
+ formControl,
})
return <form />
}
Allow us to start subscribing outside of the react component
โก๏ธ createFormControl
const { formControl, control } = createFormControl(props)
function App() {
const { register } = useForm({
formControl,
})
return <form />
}
function Test() {
useFormState({
control // no longer need context api
})
}
โก๏ธ subscribe
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 #12478 issue should unregister input with controller (#12480) โฐ close #12443 track disabled fields and only omit data on submit (#12491) โ๏ธ upg
โ๏ธ 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!
Revert "๐ฆฅ fix: useForm should return a new object on formState changes (#12424)"
Revert "๐ฆฅ fix: useForm should return a new object on formState changes (#12424)" (#12475)
๐ฆฅ fix: useForm should return a new object on formState changes (#12424) ๐งป improve prototype pollution check (#12431) ๐ช fix: add FileList availability
๐ฆฅ 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
useForm return methods will be memorized based formState update๐ fix #12398 staled disabled issue with resubmit form (#12403) ๐ fix: add type guard to fieldRef.select (#12390) Revert "๐บ watch reference update on f
๐ 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
๐ fix: #12294 ensure Invalid Date is evaluated correctly (#12295) ๐ fix #12316 setValue should work for arrays of primitives to handle checkboxes (#12
๐ 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
๐ซ๏ธ feat: #12148 support isValid when mode is set to onBlur
๐ซ๏ธ feat: #12148 support isValid when mode is set to onBlur (#12194)
// 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
onBlur with formState isValidvalidateFields will only trigger re-render for async validation๐ close #12108 useController should subscribe to exact field name of form's state (#12109) ๐ chore: upgrade app deps ๐ฉป fix: add useCallback for ref ca
๐ 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
๐ fix #12024 dirty not update issue with values prop (#12041) ๐ fix: field array validate rules shift errors
๐ fix #12024 dirty not update issue with values prop (#12041) ๐ fix: field array validate rules shift errors (#12033)
thanks to @JardelCheung
โ๏ธ close #11932 enable react 19 peer dependency (#11935) ๐ฎโโ๏ธ close #11954 getFieldState remove unnessaried inValidating and touched subscription (#11
โ๏ธ 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
๐ fix broken link to examples in README.md (#11805) โจ๏ธ close: correct type of error field in getFieldState return object (#11831) ๐ fix #11842 radio b
๐ 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
๐น close #11778 improve unregister omit key with getValues method (#11779) ๐ fix #11794 issue: Fields dirty state is not updated when passing values to
๐น close #11778 improve unregister omit key with getValues method (#11779) ๐ fix #11794 issue: Fields dirty state is not updated when passing values to useForm
๐ fix #11773 regression on dirty check with reset
๐ fix #11773 regression on dirty check with reset (#11775)
๐ fix #11719 validation stuck on true state
๐ fix #11719 validation stuck on true state (#11723)
๐ bug(validatingFields, trigger): handle all fields validation trigger (#11624) ๐ ci: cleanup actions versions (#11629) ๐ fix #11590 issue with trigge
๐ 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
๐ฌ add isValidating and validatingFields to field state
๐ฌ add isValidating and validatingFields to field state (#10657)
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
const {
formState: { validateFields },
} = useForm();
๐ฅฒ Regression: Revert "โจ๏ธ fix #10734 watch and useWatch without parameters return type (#11359)"
๐ฅฒ Regression: Revert "โจ๏ธ fix #10734 watch and useWatch without parameters return type (#11359)"
๐ง fix data param in handleSubmit when TTransformedValues is a union type (#11420) ๐ท build(Engines): remove pnpm dependency (#11425) ๐ fixes #11386 get
๐ง 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
๐ fix(formState, disabled): infer controlled disabled form state (#11361) ๐ fix(reset): remove global reset option flag (#11355) ๐ fix(useController):
๐ 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
๐ fix #11292 issue with controller validation prop
๐ fix #11292 issue with controller validation prop (#11294)
๐ fix #11276 issue with disabled omit on Controller (#11277) ๐ fix #11287 disabled prop cause const dirtyFields update
๐ fix #11276 issue with disabled omit on Controller (#11277) ๐ fix #11287 disabled prop cause const dirtyFields update (#11291)
๐ฎ feat: add reactive errors prop at useForm
๐ฎ feat: add reactive errors prop at useForm (#11188)
useForm({
errors, // server errors
})
๐ฅ๏ธ feat: add react-server bundle (#11162) ๐ฉ chore: upgrade Node.js and pnpm (#11163) ๐ช feat: add ValidationModeFlags Type (#11144) ๐ fix #11267 disabled prop does not affect controller validation (#11273) ๐ง refactor(util function): Enhance Consistency in Utility Functions: Standardizing Export, Function Types, and Naming (#11268) โจ๏ธ change type structure of UseFormHandleSubmit (#11245) ๐ฎ fix(#11239): Set fields disabled state based on form and field disabled (#11241) ๐ข improved getDirtyFieldsFromDefaultValues type (#11238) ๐ fix #11229 issue with values not re-render the root form (#11231) ๐ fix #11218 useFieldArray focus issue with rules prop (#11221) ๐ง chore: improved isObjectType and swap (#11183)
thanks to @kotarella1110, @ssi02014, @thomasdbock, @mildfuzz and @Lennon57
errors prop at useFormuseForm({
errors, // Server errors
});
๐ #11106 fix disabled prop not update dirty formState (#11143) ๐ fix controller update with disabled prop from useForm
๐ #11106 fix disabled prop not update dirty formState (#11143)
๐ fix controller update with disabled prop from useForm (#11142)
๐ fix controller update with disabled prop from useForm
๐ fix controller update with disabled prop from useForm
๐งฑ feature: disable prop for useForm
๐งฑ feature: disable prop for useForm (#10496)
const App = () => {
const [disabled, setDisabled] = useState(false);
const { handleSubmit } = useForm({ disabled });
return (
<form
onSubmit={handleSubmit(async () => {
setDisabled(true);
await sleep(100);
setDisabled(false);
})}
/ >
);
}
๐ตโ๐ซ fixed typo in useFormContext (#11126) ๐ซก strictly manage constants and improve types (#11101) ๐ fix #11076 disable toggle issue (#11090) ๐ fix: Solve the issue of race condition with resolver. (#10991) ๐ docs: fix useWatch example syntax error (#11005) ๐ readme arabic version (#10992)
thanks to @Iyadchafroud @domuk-k @mehunk @ssi02014 and @tykhan
disabled prop for useForm to disable the entire formconst App = () => {
const [disabled, setDisabled] = useState(false);
const { handleSubmit } = useForm({ disabled });
return (
<form
onSubmit={handleSubmit(async () => {
setDisabled(true);
await sleep(100);
setDisabled(false);
})}
/ >
);
}
๐ซก allow keepIsSubmitSuccessful flag
๐ซก allow keepIsSubmitSuccessful flag (#9640)
const { reset } = useForm()
<Form
onSubmit={() => {
reset(formValues, {
keepIsSubmitSuccessful: true,
});
}}
/>
๐ฆ fix typo in form.ts (#10978) ๐คก close #10907 potential fix on unmounted component (#10980) ๐ช simplify logic for subscription by name (#10947)
thanks to @stefanpl, @kai-dorschner-twinsity & @nitschSB
reset api with keepIsSubmitSuccessful option, keep successfully submitted form state.<Form
onSubmit={() => {
reset(formValues, {
keepIsSubmitSuccessful: true,
});
}}
/>
๐ fix implicit type coercion (#10949) ๐ close #10932 omit disabled prop when not defined (#10937) ๐ง fix controller test is dirty
๐ fix implicit type coercion (#10949) ๐ close #10932 omit disabled prop when not defined (#10937) ๐ง fix controller test is dirty (#10899)
thanks to @samimakicc & @pierluigigiancola
๐ fix #10878 return disabled field state
๐ fix #10878 return disabled field state (#10879)
thanks to @Moshyfawn
๐งโโ๏ธ feat: support disabled prop for useController
๐งโโ๏ธ feat: support disabled prop for useController (#10810)
const [disabled, setDisabled] = useState(false)
useController({
disabled
})
๐ซ prevent reset argument mutation (#10847) ๐ fix: add exact option for array name in useWatch. (#10707) ๐ update isDirty when setting disabled in register (#10805) ๐งถ feat: trigger passed names to construct resolver options (#10590)
thanks to @selimb @vonagam @jgullstr and @rabbitson87
disabled propconst [disabled, setDisabled] = useState(false);
useController({
disabled,
});
exact option for array name in useWatchisDirty when setting disabled in registerallow user to disable the entire form with all associated inputs
disabled propdisabled props for useFormuseForm({
disabled: true
})
const App = () => {
const [disabled, setDisabled] = useState(false);
const { register, handleSubmit, control } = useForm({
disabled,
});
return (
<form
onSubmit={handleSubmit(async () => {
setDisabled(true);
await sleep(100);
setDisabled(false);
})}
>
<input
type={'checkbox'}
{...register('checkbox')}
data-testid={'checkbox'}
/>
<input type={'radio'} {...register('radio')} data-testid={'radio'} />
<input type={'range'} {...register('range')} data-testid={'range'} />
<select {...register('select')} data-testid={'select'} />
<textarea {...register('textarea')} data-testid={'textarea'} />
<Controller control={control} render={({ field }) => <input disabled={field.disabled} />} name="test" />
<button>Submit</button>
</form>
);
}
๐ fix #10767 dep issue with replayio (#10768) ๐ fix #10762 async submit with Form component (#10766) ๐ซ add test case for issue #10744 to avoid future
๐ fix #10767 dep issue with replayio (#10768) ๐ fix #10762 async submit with Form component (#10766) ๐ซ add test case for issue #10744 to avoid future regressions (#10759)
thanks to @eg-bernardo
๐ผ add Replay Test Suites (#10681) Revert "๐งโ๐ close #10585 update controller value on each render (#10586)" ๐ close #10682 make sure action flag gets
๐ผ add Replay Test Suites (#10681) Revert "๐งโ๐ close #10585 update controller value on each render (#10586)" ๐ close #10682 make sure action flag gets reset after useEffect (#10732)
thanks to @jasonLaster
๐งพ fix(types): async defaultValues await promise value (#10637) ๐ฅฒ revert strict type check on Controller onChange (#10609) ๐ docs(changelog 7.45.0): ty
๐งพ fix(types): async defaultValues await promise value (#10637) ๐ฅฒ revert strict type check on Controller onChange (#10609) ๐ docs(changelog 7.45.0): typo and format (#10624) ๐ fix:test-spelling-error (#10629)
thanks to @anton-g, @milhamm, @moshfeu & @OlliePrentice
๐ fix #10602 issue with reactive values props update (#10606) ๐งโ๐ close #10585 update controller value on each render (#10586) ๐งช test(generated-id): s
๐ fix #10602 issue with reactive values props update (#10606) ๐งโ๐ close #10585 update controller value on each render (#10586) ๐งช test(generated-id): setting window performance undefined without ts-ignore (#10584)
thanks to @mateoguzmana
๐ close #10523 equal values prop not reset form values (#10525) ๐ชฒ fix: useFormContext ReturnType (#10543) โจ๏ธ fix onSubmit type overwrite (#10520) ๐ฎโโ๏ธ
๐ close #10523 equal values prop not reset form values (#10525)
๐ชฒ fix: useFormContext ReturnType (#10543)
โจ๏ธ fix <Form /> onSubmit type overwrite (#10520)
๐ฎโโ๏ธ enforce stricter type for controller on change callback (#10342)
๐ชฒ fix: invalid test case for useController (#10493)
๐ฎ build: use up-to-date terser plugin (#10488)
๐ซ upgrade api-extractor version (#10487)
thanks to @kotarella1110, @Moshyfawn, @swallowtail62 and @bajormar
onChange- onChange: (...event: any[]) => void;
+ onChange: (event: ChangeEvent | FieldPathValue<TFieldValues, TName>) => void;
useFormContext- export const useFormContext: <TFieldValues extends FieldValues, TransformedValues extends FieldValues | undefined = undefined>() => UseFormReturn<TFieldValues>;
+ export const useFormContext: <TFieldValues extends FieldValues, TContext = any, TransformedValues extends FieldValues | undefined = undefined>() => UseFormReturn<TFieldValues, TContext, TransformedValues>;
๐ชฒ fix: useFormContext ReturnType
๐ชฒ fix: useFormContext ReturnType (#10543)
thanks to @swallowtail62
๐ close #10523 equal values prop not reset form values (#10525) โจ๏ธ fix onSubmit type overwrite (#10520) ๐ฎโโ๏ธ enforce stricter type for controller on c
๐ close #10523 equal values prop not reset form values (#10525)
โจ๏ธ fix <Form /> onSubmit type overwrite (#10520)
๐ฎโโ๏ธ enforce stricter type for controller on change callback (#10342)
๐ชฒ fix: invalid test case for useController (#10493)
๐ฎ build: use up-to-date terser plugin (#10488)
๐ซ upgrade api-extractor version (#10487)
thanks to @kotarella1110, @Moshyfawn and @bajormar
๐ฆ fix: add named component export (#10486) ๐ญ fix React import inconsistency (#10479) ๐๏ธ fix: removed code from the README updater which was trying to
๐ฆ fix: add named component export (#10486)
๐ญ fix React import inconsistency (#10479)
๐๏ธ fix: removed code from the README updater which was trying to read a non-existent docs/Helpers.yaml
๐ fix doc: update urls from /api to /docs (#10468)
thanks to @Moshyfawn @@protofarer @farfromrest
Nothing published for this version
Nothing published for this version
๐ช fix #10456 object.hasown replaced with hasOwnProperty
๐ช fix #10456 object.hasown replaced with hasOwnProperty (#10458)
๐ fix component content-type json type missing
๐ fix <Form /> component content-type json type missing (#10454)
https://react-hook-form.com/docs/useform/form
๐ New <Form /> Component (https://github.com/react-hook-form/react-hook-form/pull/9735)
https://react-hook-form.com/docs/useform/form
// Send post request with formData
<Form
action="/api"
control={control}
onSuccess={() => {
alert("Great");
}}
/>
// Send post request with json form data
<Form action="/api" encType="application/json" headers={{ accessToken: 'test' }}>
{errors.root?.server.type === 500 && 'Error message'}
{errors.root?.server.type === 400 && 'Error message'}
</Form>
// Send post request with formData with fetch
<Form
onSubmit={async ({ formData, data, formDataJson, event }) => {
await fetch("api", {
method: "post",
body: formData,
});
}}
/>
๐๏ธ support TransformedValues with useFormContext (https://github.com/react-hook-form/react-hook-form/pull/10322)
useFormContext<FormValue, TransformedValues>()
๐ added TTransformedValues to FormProvider (https://github.com/react-hook-form/react-hook-form/pull/10368)
FormProviderProps<TFieldValues, TContext, TTransformedValues>
๐ fix https://github.com/react-hook-form/react-hook-form/issues/10139 with errors diff from the previous with field array action (https://github.com/react-hook-form/react-hook-form/pull/10216) ๐ related https://github.com/react-hook-form/react-hook-form/issues/10238 return default values in watch and useWatch when reset is called with an empty object ๐ฆฎ remove unnecessary as unknown as cast (https://github.com/react-hook-form/react-hook-form/pull/10300) ๐งโโ๏ธ close https://github.com/react-hook-form/react-hook-form/issues/10277 remove pattern empty string check (https://github.com/react-hook-form/react-hook-form/pull/10279) ๐ fix https://github.com/react-hook-form/react-hook-form/issues/9037 bugs that occur in the presence of Array polyfills (https://github.com/react-hook-form/react-hook-form/pull/10328) ๐ซฅ close https://github.com/react-hook-form/react-hook-form/issues/10348 stop shouldUseNativeValidation pass down constraint props (https://github.com/react-hook-form/react-hook-form/pull/10350) ๐ตโ๐ซ close https://github.com/react-hook-form/react-hook-form/issues/10386 re-register controller input to fix strict mode (https://github.com/react-hook-form/react-hook-form/pull/10418) โ๏ธ update form.tsx for TSdoc (https://github.com/react-hook-form/react-hook-form/pull/10399)
thanks to @yasamoka & @Torvin @ryota-murakami & @devakrishna33
Nothing published for this version
๐ Improve Form component onSubmit and remove fetcher prop
๐ Improve Form component onSubmit and remove fetcher prop (#10425)
<Form
- fetcher={(...) => {}}
+ onSubmit={await ({ formData, data, event }) => {
+ await fetch('/api', { body: formData, method: 'post' })
+ }}
/>
// With action prop, it achieve the same as above
<Form action="/api" />
๐ตโ๐ซ close #10386 re-register controller input to fix strict mode (#10418) โ๏ธ update form.tsx for TSdoc (#10399)
๐ fix #9037 bugs that occur in the presence of Array polyfills (#10328) ๐ added TTransformedValues to FormProvider
๐ fix #9037 bugs that occur in the presence of Array polyfills (#10328) ๐ added TTransformedValues to FormProvider (#10368)
FormProviderProps<TFieldValues, TContext, TTransformedValues>
๐ซฅ close #10348 stop shouldUseNativeValidation pass down constraint props (#10350)
thanks to @yasamoka & @Torvin
add try and catch for JSON.stringify
๐ Form Component (#9735)
๐ fix #10139 with errors diff from the previous with field array action (#10216)
๐ related #10238 return default values in watch and useWatch when reset is called with an empty object
thanks to @devakrishna33
๐ Form Component support custom fetcher with FormData and Json
๐ Form Component support custom fetcher with FormData and Json
<Form
action="/api"
fetcher={async (
action,
{ method, values, event, formData, formDataJson }
) => {
await fetch(action, { method, body: formData });
// or with JSON
await fetch(action, {
method,
header: { "content-type": "application/json" },
body: formDataJson,
});
}}
/>;
๐ useForm support TTransformedValues
UseFormReturn<TFieldValues, TContext, TTransformedValues>
๐ฉด close #10078 to prevent stabled async validation (#10082) ๐ fix #10064 native validation when subscribing to isValid (#10072) ๐ correct typo in field array type declaration (#10066)
thanks to @chrisbarless
One column per quarter.