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 23 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.
๐ Performance enhancement at scale
๐ Performance enhancement at scale
React hook from is getting a general performance upgrade and enhancement. The following API will get big performance improvement at scale, which means it may not improve on small or medium-size applications, but rather large and complex applications with subscriptions.
useWatchuseFieldArraywatchgetValuesResult Env: dev build + throttle 4x CPU + Chrome + MAC M1
| Version | Flat (1000) | Nested (1000) | Deeply Nested (1000 * 2 * 2000) | Flat (1000) Mount |
|---|---|---|---|---|
7.13.0-next.0 |
18ms | 20ms | 200ms | 470ms (no change) |
7.11.1 |
40ms | 43ms | 2000ms | 470ms |
๐ฆ Package size-reduction
Total Size: 30.3 kB
| Filename | Size | Change | |
|---|---|---|---|
dist/index.cjs.js |
8.39 kB | -445 B (5%) | โ |
dist/index.esm.js |
13.4 kB | -656 B (4%) | |
dist/index.umd.js |
8.52 kB | -420 B (4%) |
๐ซ Trigger
useFieldArray({ name: 'test' })
trigger('name') // will trigger the whole field array to validate
๐ register
disabled prop as an option to toggle input disable attributeref callbackregister('test', { disabled: true }) // will set value to undeinfed and pass disabled down to the input attribute
<div {...register('test')}>
<input name="test" /> // this input will be registered
</div>
๐ useWatch
disabled prop to toggle the state subscription.useWatch({ disabled: true }) // you toggle the subscription
โจ๏ธ useFormState
disabled prop to toggle the state subscription.useFormState({ disabled: true }) // you toggle the subscription
โณ๏ธ setValue
<input {...register('test.0.firstName')} />
setValue('test', [{ firstName: 'bill' }, {firstName: 'kotaro}, {firstName: 'joris'}]) // this will works
โฑ๏ธ close #6296 abort validation early when disable prop is detected (#6300) ๐น fix #6265 objects may have error messages (#6275) ๐ fix #6277 track async validate to trigger state update (#6284) ๐ fix #6272 only flush field array when subscription name match (#6281) ๐ช๐ป simplify fillEmptyArray and combine focus name (#6237) ๐ต remove redundant code for useFieldArray (#6236) ๐ patch remove, update api with key id persist (#6235) ๐ close #6233 for persist field array id (#6234) ๐ enable detect fields unmount at useWatch level (#6226) ๐จ improve useFieldArray perf (#6215) ๐จ close #6193 to remove shallow merge with defaultValue with watch (#6201) ๐ fix #6186 delayError with set error after delay (#6188) โ๏ธ enhance unregister unmount inputs by combining its logic (#6185) ๐จ๏ธ include reset clone value for array/object/date (#6183) ๐จ๐ปโ๐ง fix rendering order with useFieldArray (#6182) ๐ญ skip the shallow clone with useForm return (#6154) โจ๏ธ fix: WatchObserver info name type (#6171)
Your coding agent can read these notes before it upgrades. Set up the MCP server โ
๐ patch remove, update API with key id persist
๐ patch remove, update API with key id persist (#6235)
๐ close #6233 for persist field array id (#6234) ๐ enable detect fields unmount at useWatch level
๐ close #6233 for persist field array id (#6234) ๐ enable detect fields unmount at useWatch level (#6226)
๐จ close #6193 to remove shallow merge with defaultValue with watch (#6201) ๐จ improve useFieldArray perf
๐จ close #6193 to remove shallow merge with defaultValue with watch (#6201)
๐จ improve useFieldArray perf (#6215)
๐ fix #6186 delayError with set error after delay
๐ fix #6186 delayError with set error after delay (#6188)
๐จ๏ธ include reset clone value for array/object/date (#6183) ๐จ๐ปโ๐ง fix rendering order with useFieldArray (#6182) ๐ญ skip the shallow clone with useForm r
๐จ๏ธ include reset clone value for array/object/date (#6183) ๐จ๐ปโ๐ง fix rendering order with useFieldArray (#6182) ๐ญ skip the shallow clone with useForm return (#6154) โจ๏ธ fix: WatchObserver info name type (#6171)
This new release is going to be quite an improvement over the existing version. We will start with next (beta) version.
This new release is going to be quite an improvement over the existing version. We will start with next (beta) version.
๐ Performance enhancement at scale
React hook from is getting a general performance upgrade and enhancement. The following API will get big performance improvement at scale, which means it may not improve on small or medium-size applications, but rather large and complex applications with subscriptions.
useWatchuseFieldArraywatchgetValuesResult Env: dev build + throttle 4x CPU + Chrome + MAC M1
| Version | Flat (1000) | Nested (1000) | Deeply Nested (1000 * 2 * 2000) | Flat (1000) Mount |
|---|---|---|---|---|
7.13.0-next.0 |
18ms | 20ms | 200ms | 470ms (no change) |
7.11.1 |
40ms | 43ms | 2000ms | 470ms |
๐ฆ Package size-reduction
Total Size: 30.3 kB
| Filename | Size | Change | |
|---|---|---|---|
dist/index.cjs.js |
8.39 kB | -445 B (5%) | โ |
dist/index.esm.js |
13.4 kB | -656 B (4%) | |
dist/index.umd.js |
8.52 kB | -420 B (4%) |
๐ซ Trigger
useFieldArray({ name: 'test' })
trigger('name') // will trigger the whole field array to validate
๐ register
disabled prop as an option to toggle input disable attributeref callbackregister('test', { disabled: true }) // will set value to undeinfed and pass disabled down to the input attribute
<div {...register('test')}>
<input name="test" /> // this input will be registered
</div>
๐ useWatch
disabled prop to toggle the state subscription.useWatch({ disabled: true }) // you toggle the subscription
โจ๏ธ useFormState
disabled prop to toggle the state subscription.useFormState({ disabled: true }) // you toggle the subscription
โณ๏ธ setValue
<input {...register('test.0.firstName')} />
setValue('test', [{ firstName: 'bill' }, {firstName: 'kotaro}, {firstName: 'joris'}]) // this will works
โ๐ป close #6124 move isValid state into a separate function to unblock validation ๐ fix #6105 deep equal issue with undefined node
โ๐ป close #6124 move isValid state into a separate function to unblock validation ๐ fix #6105 deep equal issue with undefined node (#6107)
๐ fix #6090 issue with set defaultValue as string with valueAs (#6093) ๐ make sure the field is set before setting it to mounted (#6084) ๐ fix #6081 i
๐ fix #6090 issue with set defaultValue as string with valueAs (#6093)
๐ make sure the field is set before setting it to mounted (#6084)
๐ fix #6081 issue with delayError with formState (#6083)
Nothing published for this version
โ UX: useForm config delayError (#5935) `tsx useForm({ delayError: 500 // delay error appear with 500ms }) `
โ UX: useForm config delayError (#5935)
useForm({
delayError: 500 // delay error appear with 500ms
})
โจ๏ธ stricter type check on onChange event type (#6030) ๐ fix #6035 issue with Controller select toggle inValid state (#6069) ๐ fix #6055 missing dirtyFields subscribe in useFieldArray actions (#6059) ๐ fix #6052 miss marking controller as mounted (#6053)
useForm config delayErroruseForm({
delayError: 500, // delay error appear with 500ms
});
Nothing published for this version
๐ fix #5944 reset issue with unmounted useFieldArray (#5954) ๐ fix #5942 case when value is supplied as null/undefined โจ๏ธ close #5928 improve useWatch
๐ fix #5944 reset issue with unmounted useFieldArray (#5954) ๐ fix #5942 case when value is supplied as null/undefined โจ๏ธ close #5928 improve useWatch and watch types (#5945) ๐ฎ fix #5936 regression with controller value transform (#5937)
๐ update method for useFieldArray
๐
update method for useFieldArray (#5835)
const { update } = useFieldArray();
update(0, data); // update an individual field array node
๐ fix #5911 issue with reset clear flag for Controller (#5912) โจ๏ธ fix #5839 issue with null type with deepMap (#5896) ๐ close #5857 setValue missing await with trigger validation (#5859) ๐จ๐ปโ๐ป chore: allow readonly tuple in useWatch generic params (#5845)
update method to update an field array inputsconst { update } = useFieldArray();
update(0, data); // update an individual field array node
Nothing published for this version
๐๏ธ fix #5808 DeepMap extend issue with File (#5813) ๐ต๏ธ fix #5816 variable name typo in useController
๐๏ธ fix #5808 DeepMap extend issue with File (#5813) ๐ต๏ธ fix #5816 variable name typo in useController
Nothing published for this version
๐ deprecated defaultValue at useFieldArray as a required prop
๐ deprecated defaultValue at useFieldArray as a required prop (#5636)
function Test() {
const { control, register } = useForm();
const { fields, append, prepend, remove, swap, move, insert } = useFieldArray({
control,
name: "test",
});
return (
{fields.map((field, index) => (
<input
key={field.id} // important to include key with field's id
{...register(`test.${index}.value`)}
- defaultValue={field.value} // no longer required
/>
))}
);
}
๐จ๐ปโ๐ป fix #5787 controller type for defaultValue (#5792) ๐ฟ fix #5777 regression on unmount defaultValue with shouldUnregister:true (#5778) ๐ close #5724 setValue skip parse date time as object (#5729) ๐ฎ #5712 enable controller with native validation (#5716) ๐ fix spread non-primitive values in nested array fields (#5705) ๐ช batch single watch update (#5707) ๐๏ธ batch unregister inputs (#5706) ๐ fix #5699 trigger not focusing first input with error (#5700)
defaultValue is no longer a required prop for register input with useFieldArray๐ฅ feature: support browser native form control
๐ฅ feature: support browser native form control (#5503)
<img width="552" alt="Screen Shot 2021-06-19 at 10 26 37 am" src="https://user-images.githubusercontent.com/10513364/122625517-d8030a00-d0e8-11eb-800b-af047c33d916.png">
export default function App() {
const { register, handleSubmit } = useForm({
shouldUseNativeValidation: true,
});
const onSubmit = (data) => console.log(data);
return (
<form onSubmit={handleSubmit(onSubmit)}>
<input
{...register("firstName", {
required: "This is required from bill."
})}
autoComplete={"off"}
placeholder="First Name"
/>
<input type="submit" />
</form>
);
}
๐ fix #5661 trigger throw error when the field is not found (#5664) ๐ fix #5678 reset with keep default values with Controller (#5688)
useForm to enabled native browser validationconst { register, handleSubmit } = useForm({
shouldUseNativeValidation: true,
});
fix register input without defaultValue for useFieldArray
register input without defaultValue for useFieldArraydeprecate defaultValue as required prop for useFieldArray
defaultValue as required prop for useFieldArrayfunction Test() {
const { control, register } = useForm();
const { fields } = useFieldArray({
control,
name: "test",
});
return (
{fields.map((field, index) => (
<input
key={field.id} // important to include key with field's id
{...register(`test.${index}.value`)}
- defaultValue={field.value} // make sure to include defaultValue
/>
))}
);
}
๐ fix #5627 defaultValue reset inconsistent with setValueAs
๐ fix #5627 defaultValue reset inconsistent with setValueAs (#5634)
๐ fix #5623 Controller unmount to skip validation
๐ fix #5623 Controller unmount to skip validation (#5624)
๐ fix #5611 should not update dirty fields with blur event (#5614) ๐ fix #5612 trigger() always return true
๐ fix #5611 should not update dirty fields with blur event (#5614) ๐ fix #5612 trigger() always return true (#5613)
๐ผ close #5603 to enable nested field array register with useFieldArray ๐๏ธ improve useController to only return focus method from ref (#5582) ๐๏ธ improv
๐ผ close #5603 to enable nested field array register with useFieldArray ๐๏ธ improve useController to only return focus method from ref (#5582) ๐๏ธ improve useFieldArray when it's getting unmount and pulling the latest values (#5583)
useController no longer access input ref except focus event for focus management๐ fix #5555 register deeply nested field append with strict mode (#5580) ๐ fix #5566 should unregister inputs when useFieldArray unmounted (#5579) ๐ข f
๐ fix #5555 register deeply nested field append with strict mode (#5580) ๐ fix #5566 should unregister inputs when useFieldArray unmounted (#5579) ๐ข fix #5568 include . for a precise focus index lookup (#5578) ๐ต๏ธโโ๏ธ improve logic on register absent inputs (#5556) ๐ฎ fix #5538 type error with setError shouldFocus
Nothing published for this version
๐ fix #5527 resolver switching
๐ fix #5527 resolver switching (#5530)
๐ fix #5507 register with value issue
๐ fix #5507 register with value issue (#5511)
๐ fix #5499 issue with controller defaultValue overwrite defaultValues at useForm
๐ fix #5499 issue with controller defaultValue overwrite defaultValues at useForm (#5500)
๐ fix #5492 with empty reset with useController setting unmount attribute (#5493) ๐ improve logic on unmount input with ref callback (#5488) โ๏ธ featur
๐ fix #5492 with empty reset with useController setting unmount attribute (#5493) ๐ improve logic on unmount input with ref callback (#5488) โ๏ธ feature: support shouldTouch with setValue (#5181) โป๏ธ useFieldArray improvement with register value API (#5473) ๐ feature: support register with value (#5380) ๐ useFieldArray reduce function (#5471) ๐ช improve focus logic for field array (#5470) ๐ชข improve register perf and remove duplicated logic (#5469) ๐งฏ close #5440 remove extra value update (#5442) ๐ฌ remove extra ref assign (#5433) ๐ช Improve isValid form State by removing extra internal formState (#5415)
setValue support shouldTouch to update formState touchFieldssetValue('firstName', 'value', { shouldTouch: true });
register now accept value as optionregister('firstName', { value: 'value' });
isValid will initialise as falseNothing published for this version
Nothing published for this version
๐ only register absent fields with shouldUnregister: false
๐ only register absent fields with shouldUnregister: false (#5418)
shouldUnregister: false should not shallow merge or register absent input fields from defaultValues`ts trigger('firstName', { shouldFocus: true}) `
๐ feature: focus with trigger (#4960)
trigger('firstName', { shouldFocus: true})
๐งผ bubble up the error when thrown in submit handler (#5391)
trigger support focus with error inputtrigger('inputName', { shouldFocus: true });
handleSubmit will throw error within the onSubmit callback๐ close #5379 getFieldValueAs return undefined when supplied with undefined (#5381) ๐ fix #5382 trigger() return incorrect valid state
๐ close #5379 getFieldValueAs return undefined when supplied with undefined (#5381) ๐ fix #5382 trigger() return incorrect valid state (#5383)
๐ fix #5366 inline defaultValue validation (#5376) โจ๏ธ improve controller defaultValue prop type (#5375) ๐๐ปโโ๏ธ reduce logic with value check
๐ fix #5366 inline defaultValue validation (#5376) โจ๏ธ improve controller defaultValue prop type (#5375) ๐๐ปโโ๏ธ reduce logic with value check (#5356)
๐ fix #5361 remove check field logic for getFieldValues (#5363) ๐ fix #5277 Update value when switch to enabled from initial disabled state (#5350) ๐ฆ
๐ fix #5361 remove check field logic for getFieldValues (#5363) ๐ fix #5277 Update value when switch to enabled from initial disabled state (#5350) ๐ฆ update typescript and remove object define in useController (#5353)
Nothing published for this version
๐ fix #5344 avoid re-register inputs (#5345) ๐ close #5283 useFieldArray issue with restrict mode (#5331) ๐๐ปโโ๏ธ save esm bundle size (#5327) โจ๏ธ accept
๐ fix #5344 avoid re-register inputs (#5345) ๐ close #5283 useFieldArray issue with restrict mode (#5331) ๐๐ปโโ๏ธ save esm bundle size (#5327) โจ๏ธ accept readonly field path arrays (#5317)
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
๐ fix #5300 issue with register absent deep nested object (#5302) ๐ต๏ธ close #5297 issue with get with empty path
๐ fix #5300 issue with register absent deep nested object (#5302) ๐ต๏ธ close #5297 issue with get with empty path (#5298)
๐ fix #5286 useWatch with fieldArray inconsistent behaviour
๐ fix #5286 useWatch with fieldArray inconsistent behaviour (#5287)
๐ fix #5276 setValue with null
๐ fix #5276 setValue with null (#5278)
๐ fix #5246 useFieldArray with nested arrays throws error (#5251) ๐ fix #5262 register checkbox issue with absent register
๐ fix #5246 useFieldArray with nested arrays throws error (#5251) ๐ fix #5262 register checkbox issue with absent register (#5263)
๐ fix #5234 should render error logic for valid state (#5235) โจ๏ธ fix missing-register-options-generic-type
๐ fix #5234 should render error logic for valid state (#5235) โจ๏ธ fix missing-register-options-generic-type (#5238)
๐ fix #5229 issue with ref becomes undefined (#5233) ๐ improve multiple useWatch performances (#5210) ๐ close #5208 useFieldArray nested object with R
๐ fix #5229 issue with ref becomes undefined (#5233) ๐ improve multiple useWatch performances (#5210) ๐ close #5208 useFieldArray nested object with React.StrictMode (#5209)
Nothing published for this version
โจ useForm register absent defaultValues
โจ useForm register absent defaultValues (#5069)
const App = () => {
const { register, handleSubmit } = useForm({
defaultValues: {
test: { firstName: 'bill', lastName: 'luo' }
}
})
const onSubmit = (data) => {
// missing registered input will be included
console.log(data) // { test: { firstName: 'bill', lastName: 'luo' } }
}
return (
<form onSubmit={handleSubmit(onSubmit)}>
<input {...register("test.firstName")} />
<button />
</form>
)
}
useForm will register missing inputs from defaultValuesconst App = () => {
const { register, handleSubmit } = useForm({
defaultValues: {
test: { firstName: 'bill', lastName: 'luo' },
},
});
const onSubmit = (data) => {
// missing registered input will be included
console.log(data); // { test: { firstName: 'bill', lastName: 'luo' } }
};
return (
<form onSubmit={handleSubmit(onSubmit)}>
<input {...register('test.firstName')} />
<button />
</form>
);
};
๐ง close #5162 watch behavior with useFieldArray set to shouldUnregister: true
๐ง close #5162 watch behavior with useFieldArray set to shouldUnregister: true (#5173)
Nothing published for this version
Nothing published for this version
Nothing published for this version
โจ๏ธ fix #5122 type issue with the message
โจ๏ธ fix #5122 type issue with the message (#5123)
Nothing published for this version
๐ fix #5096 clearErrors with empty arg
๐ fix #5096 clearErrors with empty arg (#5098)
One column per quarter.