react-hook-form
7.91.0 · 23 Oct 2026MIT42M / weekRepositoryHomepagenpmAtom feed
595 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 6.x
6.1.1
28 Jul 2020Reading the note…
6.1.0
26 Jul 2020resolversupports both async and syncgetValueswill return default values before inputs registration
6.0.8
19 Jul 2020Reading the note…
6.0.7
17 Jul 2020Reading the note…
6.0.6
15 Jul 2020Reading the note…
6.0.5
14 Jul 2020Reading the note…
6.0.4
11 Jul 2020Reading the note…
6.0.3
10 Jul 2020Reading the note…
6.0.2
8 Jul 2020Reading the note…
6.0.1
3 Jul 2020Reading the note…
6.0.0
1 Jul 2020- breaking
Remove
validationSchemaand embrace validationresolver - breaking
Remove
nestoption forwatch&getValues, so data return from both methods will be in FormValues shape. Config for
shouldUnregisterwhich allow input to be persist even after unmount
[6.0.0] - 2020-07-1
Added
Config for
shouldUnregisterwhich allow input to be persist even after unmount
useForm({ shouldUnregister: false, // unmount input state will be remained });Auto focus with useFieldArray
append({}, (autoFocus = true)); prepend({}, (autoFocus = true)); insert({}, (autoFocus = true));TS: NestedValue
import { useForm, NestedValue } from 'react-hook-form'; type FormValues = { key1: string; key2: number; key3: NestedValue<{ key1: string; key2: number; }>; key4: NestedValue<string[]>; }; const { errors } = useForm<FormValues>(); errors?.key1?.message; // no type error errors?.key2?.message; // no type error errors?.key3?.message; // no type error errors?.key4?.message; // no type erroruseWatch(new) subscribe to registered inputs.
<input name="test" ref={register} />; function IsolateReRender() { const { state } = useWatch({ name: 'test', control, defaultValue: 'default', }); return <div>{state}</div>; }getValues()support array of field names
getValues(['test', 'test1']); // { test: 'test', test1: 'test1' }useForm({ mode: 'all' })support all validation
Changed
Rename
validationResolvertoresolverRename
validationContexttocontextRename
validateCriteriaModetocriteriaModeRename
triggerValidationtotriggerRename
clearErrortoclearErrorsRename
FormContexttoFormProviderRename
dirtytoisDirtydirtyFieldschange type fromSettoObjectController with render props API, and removed the following props:
onChange
onChangeName
onBlur
onBlurName
valueName
-<Controller - as={CustomInput} - valueName="textValue" - onChangeName="onTextChange" - control={control} - name="test" -/> +<Controller + render={({ onChange, onBlur, value }) => ( + <CustomInput onTextChange={onChange} onBlur={onBlur} textValue={value} /> + )} + control={control} + name="test" +/>setErrorwill focus one error at a time and remove confusing set multiple errors, behavior change.setError will persist an error if it's not part of the form, which requires manual remove with clearError
setError error will be removed by validation rules, rules always take over errors
- setError('test', 'test', 'test') + setError('test', { type: 'test', message: 'bill'})setValuewill focus on input at a time
setValue('test', 'value', { shouldValidate: false, shouldDirty: false })Removed
- breaking
Remove
validationSchemaand embrace validationresolver - breaking
Remove
nestoption forwatch&getValues, so data return from both methods will be in FormValues shape.
-getValues({ nest: true }); // { test: { data: 'test' }} -watch({ nest: true }); // { test: { data: 'test' }} +getValues(); // { test: { data: 'test' }} +watch(); // { test: { data: 'test' }}- 5.x
5.7.2
12 May 2020Reading the note…
5.7.1
11 May 2020Reading the note…
5.7.0
11 May 2020Reading the note…
5.6.3
8 May 2020Reading the note…
5.6.2
7 May 2020Reading the note…
5.6.1
2 May 2020Reading the note…
5.6.0
26 Apr 2020Reading the note…
5.5.3
22 Apr 2020Reading the note…
5.5.2
21 Apr 2020Reading the note…
5.5.1
20 Apr 2020Reading the note…
5.5.0
18 Apr 2020Reading the note…
5.4.2
14 Apr 2020Reading the note…
5.4.1
13 Apr 2020Reading the note…
5.4.0
12 Apr 2020Reading the note…
5.3.1
5 Apr 2020Reading the note…
5.3.0
4 Apr 2020Reading the note…
5.2.0
29 Mar 2020Reading the note…
5.1.3
22 Mar 2020Reading the note…
5.1.2
22 Mar 2020Reading the note…
5.1.1
15 Mar 2020Reading the note…
5.1.0
15 Mar 2020Reading the note…
5.0.3
9 Mar 2020Reading the note…
5.0.2
8 Mar 2020Reading the note…
5.0.1
7 Mar 2020Reading the note…
5.0.0
6 Mar 2020- breaking
Controller: onChange will only evaluate payload as event like object. eg: react-select will no longer need the extraonChangemethod atController.
- 4.x
4.10.2
6 Mar 2020Reading the note…
4.10.1
29 Feb 2020Reading the note…
4.10.0
28 Feb 2020Reading the note…
4.9.8
21 Feb 2020Reading the note…
4.9.7
20 Feb 2020Reading the note…
4.9.6
17 Feb 2020Reading the note…
4.9.5
17 Feb 2020Reading the note…
4.9.4
16 Feb 2020Reading the note…
4.9.3
11 Feb 2020Reading the note…
4.9.2
9 Feb 2020Reading the note…
4.9.1
9 Feb 2020Reading the note…
4.9.0
9 Feb 2020Reading the note…
4.8.2
3 Feb 2020Reading the note…
4.8.1
3 Feb 2020Reading the note…