react-hook-form/react-hook-form
### [`v6.15.6`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.15.6)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.15.5...v6.15.6)
:beetle: fix [#4792](https://togithub.com/react-hook-form/react-hook-form/issues/4792) issue with nested field array append
### [`v6.15.5`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.15.5)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.15.4...v6.15.5)
:beetle: fix issue with setInternalValue() for array values ([#4402](https://togithub.com/react-hook-form/react-hook-form/issues/4402))
:beetle: fix: prevent cloning objects for class-based instances ([#4400](https://togithub.com/react-hook-form/react-hook-form/issues/4400))
:beetle: fixing Field Array's remove function ([#4389](https://togithub.com/react-hook-form/react-hook-form/issues/4389))
### [`v6.15.4`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.15.4)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.15.3...v6.15.4)
:beetle: fix missing key for useFieldArray test
:beetle: fix [#4259](https://togithub.com/react-hook-form/react-hook-form/issues/4259) correct unset on field array values ([#4262](https://togithub.com/react-hook-form/react-hook-form/issues/4262))
:beetle: fix [#4260](https://togithub.com/react-hook-form/react-hook-form/issues/4260) watch missing type for undefined as the first argument ([#4261](https://togithub.com/react-hook-form/react-hook-form/issues/4261))
### [`v6.15.3`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.15.3)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.15.2...v6.15.3)
:beetle: fix [#4251](https://togithub.com/react-hook-form/react-hook-form/issues/4251) issue with re-render during unmount field array ([#4252](https://togithub.com/react-hook-form/react-hook-form/issues/4252))
๐๐ป fix: the issue of unmounted component trying to set state after reset for field arrays ([#4150](https://togithub.com/react-hook-form/react-hook-form/issues/4150))
### [`v6.15.2`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.15.2)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.15.1...v6.15.2)
:beetle: fix [#4219](https://togithub.com/react-hook-form/react-hook-form/issues/4219) Add default values when validating by using resolver ([#4229](https://togithub.com/react-hook-form/react-hook-form/issues/4229))
:beetle: fix [#4170](https://togithub.com/react-hook-form/react-hook-form/issues/4170) by removing field array [@useEffect](https://togithub.com/useEffect) with shouldUnregister ([#4172](https://togithub.com/react-hook-form/react-hook-form/issues/4172))
:beetle: fix [#4141](https://togithub.com/react-hook-form/react-hook-form/issues/4141) remove prod check at useEffect to fix dev/prod inconsistent behavior ([#4149](https://togithub.com/react-hook-form/react-hook-form/issues/4149))
### [`v6.15.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.15.1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.15.0...v6.15.1)
:beetle: fix [#4084](https://togithub.com/react-hook-form/react-hook-form/issues/4084) useWatch react with typed value ([#4085](https://togithub.com/react-hook-form/react-hook-form/issues/4085))
### [`v6.15.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#6150---2021-02-02)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.14.2...v6.15.0)
##### Changed
- radio input default selection will return `null` instead of empty string `''`
- `valueAsNumber` with empty input will return `NaN` instead of `0`
### [`v6.14.2`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.14.2)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.14.1...v6.14.2)
:dart: close [#3908](https://togithub.com/react-hook-form/react-hook-form/issues/3908) with nested field value with deep equal ([#3910](https://togithub.com/react-hook-form/react-hook-form/issues/3910))
:beetle: fix [#3875](https://togithub.com/react-hook-form/react-hook-form/issues/3875) with nested useFieldArray remount ([#3900](https://togithub.com/react-hook-form/react-hook-form/issues/3900))
:martial_arts_uniform: fix [#3850](https://togithub.com/react-hook-form/react-hook-form/issues/3850) change method from pop to slice ([#3866](https://togithub.com/react-hook-form/react-hook-form/issues/3866))
### [`v6.14.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.14.1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.14.0...v6.14.1)
:beetle: fix [#3851](https://togithub.com/react-hook-form/react-hook-form/issues/3851) with invalid formState type ([#3854](https://togithub.com/react-hook-form/react-hook-form/issues/3854))
:beetle: fix [#3834](https://togithub.com/react-hook-form/react-hook-form/issues/3834) dirty fields reset after input unmount with shouldUnregister: false
:beetle: fix [#3819](https://togithub.com/react-hook-form/react-hook-form/issues/3819) issue with dirty fields during swop action ([#3824](https://togithub.com/react-hook-form/react-hook-form/issues/3824))
### [`v6.14.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#6140---2020-12-31)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.13.1...v6.14.0)
##### Changed
- `setValue` without shouldUnregister:false will no longer deep clone its value instead with shallow clone
##### Added
- new formState `isValidating`, this will set to `true` during validation.
```ts
const {
formState: { isValidating },
} = useForm();
```
### [`v6.13.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.13.1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.13.0...v6.13.1)
:beetle: fix [#3689](https://togithub.com/react-hook-form/react-hook-form/issues/3689) missing id with nested child array ([#3690](https://togithub.com/react-hook-form/react-hook-form/issues/3690))
:beetle: fix [#3684](https://togithub.com/react-hook-form/react-hook-form/issues/3684) issue validate pattern with value as null ([#3685](https://togithub.com/react-hook-form/react-hook-form/issues/3685))
:package: close [#3677](https://togithub.com/react-hook-form/react-hook-form/issues/3677) improve setValue with field array ([#3688](https://togithub.com/react-hook-form/react-hook-form/issues/3688))
:face_with_rolling_eyes: close [#3664](https://togithub.com/react-hook-form/react-hook-form/issues/3664) with async useFieldArray remove ([#3665](https://togithub.com/react-hook-form/react-hook-form/issues/3665))
### [`v6.13.0`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.13.0)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.12.2...v6.13.0)
:star2: custom hook: useController ([#3488](https://togithub.com/react-hook-form/react-hook-form/issues/3488))
```tsx
import React from "react";
import { useController } from "react-hook-form";
function Input({ control, name }) {
const {
field,
meta: { invalid, isTouched, isDirty },
} = useController({
name,
control,
rules: { required: true },
});
return ;
}
```
๐จ๐ปโ๐ป fix [#3613](https://togithub.com/react-hook-form/react-hook-form/issues/3613) `shouldUnregister:false` with `append` deep clone object ([#3614](https://togithub.com/react-hook-form/react-hook-form/issues/3614))
:beetle: fix [#3617](https://togithub.com/react-hook-form/react-hook-form/issues/3617) remove fields from append dep ([#3618](https://togithub.com/react-hook-form/react-hook-form/issues/3618))
๐จ๐ปโ๐ป close [#3628](https://togithub.com/react-hook-form/react-hook-form/issues/3628) `reset` inconsistency with different `shouldUnregister` mode ([#3633](https://togithub.com/react-hook-form/react-hook-form/issues/3633))
:keyboard: fix [#3593](https://togithub.com/react-hook-form/react-hook-form/issues/3593) Map type for NestedValue ([#3616](https://togithub.com/react-hook-form/react-hook-form/issues/3616))
:crying_cat_face: [#1680](https://togithub.com/react-hook-form/react-hook-form/issues/1680) fix unmount warning on dev build ([#3645](https://togithub.com/react-hook-form/react-hook-form/issues/3645))
:ghost: fix [#3651](https://togithub.com/react-hook-form/react-hook-form/issues/3651) `setValue` with `shouldUnregister:false` with deep clone object ([#3652](https://togithub.com/react-hook-form/react-hook-form/issues/3652))
:robot_face: change from deepClone to shallowClone with defaultValues's reset ([#3607](https://togithub.com/react-hook-form/react-hook-form/issues/3607))
### [`v6.12.2`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.12.2)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.12.1...v6.12.2)
:beetle: fix 3577 issue with Controller register at FieldArray ([#3583](https://togithub.com/react-hook-form/react-hook-form/issues/3583))
:right-facing_fist: improve useFieldArray fast refresh ([#3576](https://togithub.com/react-hook-form/react-hook-form/issues/3576))
:beetle: fix input range max/min validation ([#3575](https://togithub.com/react-hook-form/react-hook-form/issues/3575))
:handshake: make cloneObject work in both Node & browsers ([#3571](https://togithub.com/react-hook-form/react-hook-form/issues/3571))
### [`v6.12.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.12.1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.12.0...v6.12.1)
:beetle: fix controller register issue with field array ([#3561](https://togithub.com/react-hook-form/react-hook-form/issues/3561))
:beetle: fix fast refresh ([#3559](https://togithub.com/react-hook-form/react-hook-form/issues/3559))
:beetle: fix [#3539](https://togithub.com/react-hook-form/react-hook-form/issues/3539) issue with JSX deepEqual ([#3558](https://togithub.com/react-hook-form/react-hook-form/issues/3558))
๐จ๐ปโ๐ป improve DX with field array and fast refresh ([#3551](https://togithub.com/react-hook-form/react-hook-form/issues/3551))
### [`v6.12.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#6120---2020-12-12)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.11.5...v6.12.0)
##### Changed
- When invoking `reset({ value })` value will be shallow clone value object which you have supplied instead of deepClone.
```tsx
// :x: avoid the following with deep nested default values
const defaultValues = { object: { deepNest: { file: new File() } } };
useForm({ defaultValues });
reset(defaultValues); // share the same reference
// :white_check_mark: it's safer with the following, as we only doing shallow clone with defaultValues
useForm({ deepNest: { file: new File() } });
reset({ deepNest: { file: new File() } });
```
##### Added
- New custom hook `useController`: This custom hook is what powers Controller, and shares the same props and methods as Controller. It's useful to create reusable Controlled input, while Controller is the flexible option to drop into your page or form.
```tsx
import React from 'react';
import { TextField } from '@material-ui/core';
import { useController } from 'react-hook-form';
function Input({ control, name }) {
const {
field: { ref, ...inputProps },
meta: { invalid, isTouched, isDirty },
} = useController({
name,
control,
rules: { required: true },
defaultValue: '',
});
return ;
}
```
### [`v6.11.5`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.11.5)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.11.4...v6.11.5)
Revert ":nut_and_bolt: defaultValues test cases for useFieldArray ([#3420](https://togithub.com/react-hook-form/react-hook-form/issues/3420))" ([#3503](https://togithub.com/react-hook-form/react-hook-form/issues/3503))
### [`v6.11.4`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.11.4)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.11.3...v6.11.4)
:beetle: fix [#3482](https://togithub.com/react-hook-form/react-hook-form/issues/3482) remove nested dirty fields ([#3486](https://togithub.com/react-hook-form/react-hook-form/issues/3486))
๐จ๐ปโ๐ป reduce code + fix dirtyFields with field array + improve DX with fast refresh [#1680](https://togithub.com/react-hook-form/react-hook-form/issues/1680) ([#3474](https://togithub.com/react-hook-form/react-hook-form/issues/3474))
๐จ๐ปโ๐ป close [#3642](https://togithub.com/react-hook-form/react-hook-form/issues/3642) issue with dev script ([#3463](https://togithub.com/react-hook-form/react-hook-form/issues/3463))
:ok_hand: use `useField` internally for Controller ([#3483](https://togithub.com/react-hook-form/react-hook-form/issues/3483))
### [`v6.11.3`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.11.3)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.11.2...v6.11.3)
:beetle: fix [#3460](https://togithub.com/react-hook-form/react-hook-form/issues/3460) issue with nested schema ([#3461](https://togithub.com/react-hook-form/react-hook-form/issues/3461))
### [`v6.11.2`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.11.2)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.11.1...v6.11.2)
:beetle: fix [#3450](https://togithub.com/react-hook-form/react-hook-form/issues/3450) append focus index ([#3453](https://togithub.com/react-hook-form/react-hook-form/issues/3453))
### [`v6.11.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.11.1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.11.0...v6.11.1)
:beetle: fix [#3440](https://togithub.com/react-hook-form/react-hook-form/issues/3440) setError with concurrent isSubmitting ([#3443](https://togithub.com/react-hook-form/react-hook-form/issues/3443))
:beetle: fix setValue name type and checkbox with shouldUnregister:false ([#3432](https://togithub.com/react-hook-form/react-hook-form/issues/3432))
:beetle: fix [#3416](https://togithub.com/react-hook-form/react-hook-form/issues/3416) date compare ([#3419](https://togithub.com/react-hook-form/react-hook-form/issues/3419))
:package: [other] Reduce npm package size ([#3413](https://togithub.com/react-hook-form/react-hook-form/issues/3413))
:beetle: fix [#3404](https://togithub.com/react-hook-form/react-hook-form/issues/3404) reset isValid with resolver ([#3410](https://togithub.com/react-hook-form/react-hook-form/issues/3410))
๐จ๐ปโ๐ป add warning on ref.current.focus when it is not a function ([#3407](https://togithub.com/react-hook-form/react-hook-form/issues/3407))
๐จ๐ปโ๐ป close [#3329](https://togithub.com/react-hook-form/react-hook-form/issues/3329) useWatch return value to skip extra re-render
### [`v6.11.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#6110---2020-11-07)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.10.1...v6.11.0)
##### Changed
- `defaultValues` is **required** to measure `isDirty`, keep a single source of truth to avoid multiple issues raised around `isDirty`
- when `watch` with `useFieldArray`, `fields` object is no longer required as defaultValue
```diff
- watch('fieldArray', fields);
+ watch('fieldArray');
```
### [`v6.10.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.10.1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.10.0...v6.10.1)
:beetle: fix [#3321](https://togithub.com/react-hook-form/react-hook-form/issues/3321) deepEqual with null vs non-primitive data type ([#3322](https://togithub.com/react-hook-form/react-hook-form/issues/3322))
### [`v6.10.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#6100---2020-10-31)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.9.6...v6.10.0)
##### Added
- `Controller` will have an extra `ref` props to improve DX in terms of focus management.
```tsx
{
return (
);
}}
/>
// focus will work correct without the `onFocus` prop
} />
```
##### Changed
- `resolver` with group error object will no longer need with `trigger` to show and clear error. This minor version made hook form look at parent error node to detect if there is any group error to show and hide.
```tsx
const schema = z.object({
items: z.array(z.boolean()).refine((items) => items.some((item) => item)),
});
{
items.map((flag, index) => (
trigger("items")} now can be removed
ref={register}
name={`items.${index}`}
/>
));
}
```
### [`v6.9.6`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.9.6)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.9.5...v6.9.6)
:beetle: fix [#3223](https://togithub.com/react-hook-form/react-hook-form/issues/3223) clone object with File ([#3225](https://togithub.com/react-hook-form/react-hook-form/issues/3225))
:bullettrain_front: reading error from updated errors object ([#3233](https://togithub.com/react-hook-form/react-hook-form/issues/3233))
๐จ๐ปโ๐ป fix [#3213](https://togithub.com/react-hook-form/react-hook-form/issues/3213) with extra check with dirty fields ([#3234](https://togithub.com/react-hook-form/react-hook-form/issues/3234))
:beetle: fix [#3238](https://togithub.com/react-hook-form/react-hook-form/issues/3238) Controller unregister triggers validation ([#3244](https://togithub.com/react-hook-form/react-hook-form/issues/3244))
๐จ๐ปโ๐ป [#3246](https://togithub.com/react-hook-form/react-hook-form/issues/3246) fix clone object with Set and Map type ([#3247](https://togithub.com/react-hook-form/react-hook-form/issues/3247))
### [`v6.9.5`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.9.5)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.9.4...v6.9.5)
:sneezing_face: fix [#3205](https://togithub.com/react-hook-form/react-hook-form/issues/3205) regression with useWatch not return defaultValue
:sneezing_face: fix [#3209](https://togithub.com/react-hook-form/react-hook-form/issues/3209) regression with setValue FieldArray
:sneezing_face: fix [#3212](https://togithub.com/react-hook-form/react-hook-form/issues/3212) regression with reset shallowStateRef
:beetle: fix watch & useWatch with input gets unmounted
### [`v6.9.4`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.9.4)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.9.3...v6.9.4)
:beetle: fix [#3193](https://togithub.com/react-hook-form/react-hook-form/issues/3193) isDirty with shouldUnregister issue with object clone ([#3194](https://togithub.com/react-hook-form/react-hook-form/issues/3194))
Revert ":bulb: refactor: purge scripts ([#3126](https://togithub.com/react-hook-form/react-hook-form/issues/3126))"
### [`v6.9.3`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.9.3)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.9.2...v6.9.3)
:beetle: fix/shallow state clone ([#3185](https://togithub.com/react-hook-form/react-hook-form/issues/3185))
:birthday: use ref touched fields instead touched ([#3175](https://togithub.com/react-hook-form/react-hook-form/issues/3175))
:beetle: fix [#3166](https://togithub.com/react-hook-form/react-hook-form/issues/3166) Conditional controlled value keeps registered even if the controller is unmounted
:beetle: fix [#3158](https://togithub.com/react-hook-form/react-hook-form/issues/3158) with dirtyFields with useFieldArray ([#3165](https://togithub.com/react-hook-form/react-hook-form/issues/3165))
:beetle:fix [#3154](https://togithub.com/react-hook-form/react-hook-form/issues/3154) with field array set dirty issue ([#3161](https://togithub.com/react-hook-form/react-hook-form/issues/3161))
:birthday: improve transformToNestObject ([#3148](https://togithub.com/react-hook-form/react-hook-form/issues/3148))
:drum_with_drumsticks: include Type useFieldArrayMethods ([#3145](https://togithub.com/react-hook-form/react-hook-form/issues/3145))
:roller_coaster: refactor: let SubmitHandler return any instead of void ([#3135](https://togithub.com/react-hook-form/react-hook-form/issues/3135))
:vertical_traffic_light: fix [#3088](https://togithub.com/react-hook-form/react-hook-form/issues/3088) issue DeepPartial with interface ([#3129](https://togithub.com/react-hook-form/react-hook-form/issues/3129))
๐จ๐ปโ๐ป improve field array dirty fields checking ([#3127](https://togithub.com/react-hook-form/react-hook-form/issues/3127))
:bulb: refactor: purge scripts ([#3126](https://togithub.com/react-hook-form/react-hook-form/issues/3126))
๐จ๐ปโ๐ป fix useFieldArray delete dirty fields ([#3119](https://togithub.com/react-hook-form/react-hook-form/issues/3119))
### [`v6.9.2`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.9.2)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.9.1...v6.9.2)
:beetle: fix [#3098](https://togithub.com/react-hook-form/react-hook-form/issues/3098) issue on initial re-render with errors ([#3102](https://togithub.com/react-hook-form/react-hook-form/issues/3102))
### [`v6.9.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.9.1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.9.0...v6.9.1)
๐จ๐ปโ๐ซ fix reset useFieldArray's shallowFieldsStateRef ([#3094](https://togithub.com/react-hook-form/react-hook-form/issues/3094))
:beetle: fix issues [#3085](https://togithub.com/react-hook-form/react-hook-form/issues/3085) [#3090](https://togithub.com/react-hook-form/react-hook-form/issues/3090) ([#3091](https://togithub.com/react-hook-form/react-hook-form/issues/3091))
:beetle: fix [#3082](https://togithub.com/react-hook-form/react-hook-form/issues/3082) issue with resolver not getting correct form values
๐จ๐ปโ๐ป close [#3080](https://togithub.com/react-hook-form/react-hook-form/issues/3080) useFieldArray: should unregister false with append ([#3081](https://togithub.com/react-hook-form/react-hook-form/issues/3081))
๐จ๐ปโ๐ป close [#3066](https://togithub.com/react-hook-form/react-hook-form/issues/3066) improve resolver at input registration ([#3069](https://togithub.com/react-hook-form/react-hook-form/issues/3069))
### [`v6.9.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#690---2020-10-3)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.8.6...v6.9.0)
##### Changed
- with shouldUnregister set to false, empty Field Array will default \[] as submission result.
```tsx
const { handleSubmit } = useForm({
shouldUnregister: false,
});
useFieldArray({
name: 'test',
});
handleSubmit((data) => {
// shouldUnregister: false
// result: { data: {test: []} }
// shouldUnregister: true
// result: {}
});
```
### [`v6.8.6`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.8.6)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.8.5...v6.8.6)
revert :keyboard: refactor UseFormMethods to arrow functions ([#2899](https://togithub.com/react-hook-form/react-hook-form/issues/2899))
### [`v6.8.5`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.8.5)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.8.4...v6.8.5)
:beetle: fix [#2968](https://togithub.com/react-hook-form/react-hook-form/issues/2968) issue with shallowFieldsStateRef remain empty with append action ([#2970](https://togithub.com/react-hook-form/react-hook-form/issues/2970))
:beetle: fix [#2972](https://togithub.com/react-hook-form/react-hook-form/issues/2972) issue around setValue's trigger not update async isValid ([#2975](https://togithub.com/react-hook-form/react-hook-form/issues/2975))
:beetle: fix UnpackNestedValue type ([#2986](https://togithub.com/react-hook-form/react-hook-form/issues/2986))
:keyboard: refactor UseFormMethods to arrow functions ([#2899](https://togithub.com/react-hook-form/react-hook-form/issues/2899))
๐จ๐ปโ๐ป close [#2990](https://togithub.com/react-hook-form/react-hook-form/issues/2990) improve dev mode warning ([#2991](https://togithub.com/react-hook-form/react-hook-form/issues/2991))
:clinking_glasses: improve useFieldArray and useWatch ([#2997](https://togithub.com/react-hook-form/react-hook-form/issues/2997))
### [`v6.8.4`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#684---2020-09-22)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.8.3...v6.8.4)
##### Changed
- when input unmounts `touched` and `dirtyFields` will no longer get removed from `formState` (shouldUnregister: true).
### [`v6.8.3`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.8.3)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.8.2...v6.8.3)
Revert "๐จ๐ปโ๐ป throw warning when watched input is not found ([#2890](https://togithub.com/react-hook-form/react-hook-form/issues/2890))"
:beetle: fix [#2918](https://togithub.com/react-hook-form/react-hook-form/issues/2918) isDirty/dirtyFields state with setValue/useFieldArray
:beetle: fix [#2917](https://togithub.com/react-hook-form/react-hook-form/issues/2917) set value with hidden input and update tests
### [`v6.8.2`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.8.2)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.8.1...v6.8.2)
:wine_glass: add declaration types for ie11 ([#2870](https://togithub.com/react-hook-form/react-hook-form/issues/2870))
:beetle: fix [#2877](https://togithub.com/react-hook-form/react-hook-form/issues/2877) issue with dirtyFields with single node ([#2882](https://togithub.com/react-hook-form/react-hook-form/issues/2882))
๐จ๐ปโ๐ป close [#2884](https://togithub.com/react-hook-form/react-hook-form/issues/2884) & minor code improvement ([#2883](https://togithub.com/react-hook-form/react-hook-form/issues/2883))
:man-tipping-hand: improve DX with a warning message for isValid
๐จ๐ปโ๐ป throw a warning when watched input is not found ([#2890](https://togithub.com/react-hook-form/react-hook-form/issues/2890))
### [`v6.8.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.8.1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.8.0...v6.8.1)
:beetle: fix [#2859](https://togithub.com/react-hook-form/react-hook-form/issues/2859) async isSubmitSuccessful ([#2867](https://togithub.com/react-hook-form/react-hook-form/issues/2867))
๐ฅบ include missing reset isSubmitSuccessful ([#2857](https://togithub.com/react-hook-form/react-hook-form/issues/2857))
### [`v6.8.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#680---2020-09-09)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.7.2...v6.8.0)
##### Added
- new formState `isSubmitSuccessful` to indicate successful submission
- `setError` now support focus on the actual input
```typescript jsx
setError('test', { message: 'This is required', shouldFocus: true });
```
##### Changed
- with `shouldUnregister:false` `defaultValues` data will be part of the submission data
- with `shouldUnregister:false` conditional field is going to work with `useFieldArray`
- `setValue` now support `useFieldArray`
```diff
- setValue('test', 'data')
+ setValue('test', [{ test: '123' }]) // make it work for useFieldArray and target a field array key
```
- remove `exact` config at clearErrors
```diff
- clearErrors('test', { exact: false })
+ clearErrors('test') // does it automatically in the lib
```
### [`v6.7.2`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.7.2)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.7.1...v6.7.2)
:beetle: fix [#2812](https://togithub.com/react-hook-form/react-hook-form/issues/2812) with submitting ([#2814](https://togithub.com/react-hook-form/react-hook-form/issues/2814))
:blowfish: add MutationObserver to interface stubs for React Native ([#2807](https://togithub.com/react-hook-form/react-hook-form/issues/2807))
:hand_with_index_and_middle_fingers_crossed: improve proxy state ([#2818](https://togithub.com/react-hook-form/react-hook-form/issues/2818))
### [`v6.7.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.7.1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.7.0...v6.7.1)
:beetle: fix(controller): close [#2792](https://togithub.com/react-hook-form/react-hook-form/issues/2792) add isTouched argument ([#2794](https://togithub.com/react-hook-form/react-hook-form/issues/2794))
๐จ๐ปโ๐ป close [#2755](https://togithub.com/react-hook-form/react-hook-form/issues/2755) with radio input same name ([#2790](https://togithub.com/react-hook-form/react-hook-form/issues/2790))
:beetle: fix issues [#2785](https://togithub.com/react-hook-form/react-hook-form/issues/2785) [#2755](https://togithub.com/react-hook-form/react-hook-form/issues/2755) ([#2789](https://togithub.com/react-hook-form/react-hook-form/issues/2789))
:female-police-officer: enhance Controller props type ([#2786](https://togithub.com/react-hook-form/react-hook-form/issues/2786))
๐จ๐ปโ๐ป removes redundant dependencies in append and remove of useFieldArray ([#2780](https://togithub.com/react-hook-form/react-hook-form/issues/2780))
### [`v6.7.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#670---2020-08-30)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.6.0...v6.7.0)
##### Added
- `clearError` have second option argument for clear errors which are exact or key name
```ts
register('test.firstName', { required: true });
register('test.lastName', { required: true });
clearErrors('test', { exact: false }); // will clear both errors from test.firstName and test.lastName
clearErrors('test.firstName'); // for clear single input error
```
### [`v6.6.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#660---2020-08-28)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.5.3...v6.6.0)
##### Changed
- all types from this lib has been exported. **Important:** only documented type: will avoid breaking change.
### [`v6.5.3`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.5.3)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.5.2...v6.5.3)
๐จ๐ปโ๐ป fix ref destructure
:beetle: fix useFieldArray append diirtyFields issue ([#2705](https://togithub.com/react-hook-form/react-hook-form/issues/2705))
### [`v6.5.2`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.5.2)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.5.1...v6.5.2)
:steam_locomotive: export types and fix minor issues ([#2703](https://togithub.com/react-hook-form/react-hook-form/issues/2703))
๐ ๐ฝโโ๏ธ improve rollup config to support ie11 ([#2702](https://togithub.com/react-hook-form/react-hook-form/issues/2702))
๐จ๐ปโ๐ป export FieldValues, FormStateProxy types from the main package ([#2640](https://togithub.com/react-hook-form/react-hook-form/issues/2640))
### [`v6.5.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.5.1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.5.0...v6.5.1)
:beetle: fix `useWatch` stale value ([#2693](https://togithub.com/react-hook-form/react-hook-form/issues/2693))
:eyes: improved `MutationObserver` usage ([#2670](https://togithub.com/react-hook-form/react-hook-form/issues/2670))
### [`v6.5.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#650---2020-08-23)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.4.1...v6.5.0)
##### Changed
- `errors` is also part of `formState` object
- `disabled` input will not be part of the submission data by following the [HTML standard](https://html.spec.whatwg.org/multipage/forms.html#constructing-the-form-data-set)
### [`v6.4.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.4.1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.4.0...v6.4.1)
:beetle: fix [#2609](https://togithub.com/react-hook-form/react-hook-form/issues/2609) deepMerge with date type ([#2610](https://togithub.com/react-hook-form/react-hook-form/issues/2610))
:trophy: improve NestedValue type to support class type ([#2635](https://togithub.com/react-hook-form/react-hook-form/issues/2635))
:speech_balloon: improve errors types to enable auto-complete ([#2634](https://togithub.com/react-hook-form/react-hook-form/issues/2634))
### [`v6.4.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#640---2020-08-15)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.3.3...v6.4.0)
##### Added
- `Controller`'s `render` prop will pass down `name` prop
- `handleSubmit` take a second callback for errors callback
- new mode `onTouched` will only trigger validation after inputs are touched
##### Changed
- `register` no longer compare `ref` difference with React Native
### [`v6.3.3`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.3.3)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.3.2...v6.3.3)
:eyes: close [#2516](https://togithub.com/react-hook-form/react-hook-form/issues/2516) improve useWatch by stop caching name ([#2571](https://togithub.com/react-hook-form/react-hook-form/issues/2571))
:beetle: fix [#2565](https://togithub.com/react-hook-form/react-hook-form/issues/2565) issue with cached validate resolver ([#2566](https://togithub.com/react-hook-form/react-hook-form/issues/2566))
:beetle: fix [#2548](https://togithub.com/react-hook-form/react-hook-form/issues/2548) issue with isDirty formState ([#2554](https://togithub.com/react-hook-form/react-hook-form/issues/2554))
:sneezing_face: fix ie build ([#2551](https://togithub.com/react-hook-form/react-hook-form/issues/2551))
:beetle: fix [#2538](https://togithub.com/react-hook-form/react-hook-form/issues/2538) formState with nested field array ([#2539](https://togithub.com/react-hook-form/react-hook-form/issues/2539))
### [`v6.3.2`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#632---2020-08-11)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.3.1...v6.3.2)
##### Changed
- IE 11 version will be required to install `@babel/runtime-corejs3` as dependency at your own project
### [`v6.3.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.3.1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.3.0...v6.3.1)
:heart: close [#2509](https://togithub.com/react-hook-form/react-hook-form/issues/2509) reset with empty argument ([#2514](https://togithub.com/react-hook-form/react-hook-form/issues/2514))
:helmet_with_white_cross: create global.d.ts that defined the DOM interfaces for ReactNative ([#2518](https://togithub.com/react-hook-form/react-hook-form/issues/2518))
:beetle: fix [#2512](https://togithub.com/react-hook-form/react-hook-form/issues/2512) regression with useFieldArray default values ([#2517](https://togithub.com/react-hook-form/react-hook-form/issues/2517))
:keyboard: change from MutationWatcher to MutationObserver type ([#2520](https://togithub.com/react-hook-form/react-hook-form/issues/2520))
:tada: fixed error handling ([#2470](https://togithub.com/react-hook-form/react-hook-form/issues/2470))
:beetle: fix a rollup config for ie11 ([#2489](https://togithub.com/react-hook-form/react-hook-form/issues/2489))
:ghost: improved useWatch test ([#2478](https://togithub.com/react-hook-form/react-hook-form/issues/2478))
๐จ๐ปโ๐ป improve console.warn with Controller ([#2469](https://togithub.com/react-hook-form/react-hook-form/issues/2469))
:ghost: improved useFieldArray test ([#2467](https://togithub.com/react-hook-form/react-hook-form/issues/2467))
### [`v6.3.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#630---2020-08-8)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.2.0...v6.3.0)
##### Changed
- `defaultValue` is become **required** for `useFieldArray` at each input
### [`v6.2.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#620---2020-07-30)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.1.2...v6.2.0)
##### Changed
- revert `getValues` will return default values before inputs registration
### [`v6.1.2`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.1.2)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.1.1...v6.1.2)
:beetle: fix [#2395](https://togithub.com/react-hook-form/react-hook-form/issues/2395) bug with `isDirty` due to `useFieldArray` delete ([#2396](https://togithub.com/react-hook-form/react-hook-form/issues/2396))
### [`v6.1.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.1.1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.1.0...v6.1.1)
:beetle: fix [#2382](https://togithub.com/react-hook-form/react-hook-form/issues/2382) issue with defaultValues inside submit values ([#2390](https://togithub.com/react-hook-form/react-hook-form/issues/2390))
:grimacing: fixed dirty bugs with useFieldArray ([#2368](https://togithub.com/react-hook-form/react-hook-form/issues/2368))
๐งช increase test coverage ([#2385](https://togithub.com/react-hook-form/react-hook-form/issues/2385))
### [`v6.1.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#610---2020-07-26)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.0.8...v6.1.0)
##### Changed
- `resolver` supports both async and sync
- `getValues` will return default values before inputs registration
### [`v6.0.8`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.0.8)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.0.7...v6.0.8)
:fox_face: fix firefox setDirty issue ([#2277](https://togithub.com/react-hook-form/react-hook-form/issues/2277))
:keyboard: fix type for MutationObserver observe method
:handshake: improve watch internal ([#2270](https://togithub.com/react-hook-form/react-hook-form/issues/2270))
:beetle: fix the issue with getValues nested object wth shouldUnregister to false ([#2278](https://togithub.com/react-hook-form/react-hook-form/issues/2278))
:male_mage: increase unit tests coverage
### [`v6.0.7`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#607---2020-07-17)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.0.6...v6.0.7)
##### Added
- export `ArrayField` type
##### Changed
- error message will support array of messages for specific type
```diff
- export type ValidateResult = Message | boolean | undefined;
+ export type ValidateResult = Message | Message[] | boolean | undefined;
```
### [`v6.0.6`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.0.6)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.0.5...v6.0.6)
:beetle: fix [#2220](https://togithub.com/react-hook-form/react-hook-form/issues/2220) with getValues() ([#2230](https://togithub.com/react-hook-form/react-hook-form/issues/2230))
### [`v6.0.5`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.0.5)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.0.4...v6.0.5)
:beetle: fix [#2191](https://togithub.com/react-hook-form/react-hook-form/issues/2191) with unset nested error ([#2207](https://togithub.com/react-hook-form/react-hook-form/issues/2207))
:male_mage: improved handleChangeRef test ([#2204](https://togithub.com/react-hook-form/react-hook-form/issues/2204))
:beetle: fixed useForm test bugs ([#2189](https://togithub.com/react-hook-form/react-hook-form/issues/2189))
:collision: improved bundle size with production code ([#2183](https://togithub.com/react-hook-form/react-hook-form/issues/2183))
:beetle: fix [#2153](https://togithub.com/react-hook-form/react-hook-form/issues/2153) issue with reValidate blur mode ([#2175](https://togithub.com/react-hook-form/react-hook-form/issues/2175))
:beetle: fix getValues when shouldUnregister set to false ([#2166](https://togithub.com/react-hook-form/react-hook-form/issues/2166))
:beetle: fix [#2160](https://togithub.com/react-hook-form/react-hook-form/issues/2160) issue with useFieldArray move and swap ([#2161](https://togithub.com/react-hook-form/react-hook-form/issues/2161))
### [`v6.0.4`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.0.4)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.0.3...v6.0.4)
:beetle: fix [#2160](https://togithub.com/react-hook-form/react-hook-form/issues/2160) issue with useFieldArray move and swap
### [`v6.0.3`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#603---2020-07-10)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.0.2...v6.0.3)
##### Changed
- Controller `onFocus` works with React Native
- Controller stop producing `checked` prop by boolean `value`
### [`v6.0.2`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#602---2020-07-8)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.0.1...v6.0.2)
##### Added
- export `UseFormOptions`, `UseFieldArrayOptions`, `FieldError`, `Field` and `Mode` type
### [`v6.0.1`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#601---2020-07-3)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.0.0...v6.0.1)
##### Added
- export `ValidationRules` type
### [`v6.0.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#600---2020-07-1)
[Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v5.7.2...v6.0.0)
##### Added
- config for `shouldUnregister` which allow input to be persist even after unmount
```typescript
useForm({
shouldUnregister: false, // unmount input state will be remained
});
```
- auto focus with useFieldArray
```ts
append({}, (autoFocus = true));
prepend({}, (autoFocus = true));
insert({}, (autoFocus = true));
```
- TS: NestedValue
```tsx
import { useForm, NestedValue } from 'react-hook-form';
type FormValues = {
key1: string;
key2: number;
key3: NestedValue<{
key1: string;
key2: number;
}>;
key4: NestedValue;
};
const { errors } = useForm();
errors?.key1?.message; // no type error
errors?.key2?.message; // no type error
errors?.key3?.message; // no type error
errors?.key4?.message; // no type error
```
- `useWatch` (new) subscribe to registered inputs.
```tsx
;
function IsolateReRender() {
const { state } = useWatch({
name: 'test',
control,
defaultValue: 'default',
});
return
{state}
;
}
```
- `getValues()` support array of field names
```typescript jsx
getValues(['test', 'test1']); // { test: 'test', test1: 'test1' }
```
- `useForm({ mode: 'all' })` support all validation
##### Changed
- rename `validationResolver` to `resolver`
- rename `validationContext` to `context`
- rename `validateCriteriaMode` to `criteriaMode`
- rename `triggerValidation` to `trigger`
- rename `clearError` to `clearErrors`
- rename `FormContext` to `FormProvider`
- rename `dirty` to `isDirty`
- `dirtyFields` change type from `Set` to `Object`
- Controller with render props API, and removed the following props:
- onChange
- onChangeName
- onBlur
- onBlurName
- valueName
```diff
-
+ (
+
+ )}
+ control={control}
+ name="test"
+/>
```
- `setError` will focus one error at a time and remove confusing set multiple errors, behavior change.
- setError will persis 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
```diff
- setError('test', 'test', 'test')
+ setError('test', { type: 'test', message: 'bill'})
```
- `setValue` will focus on input at a time
```diff
setValue('test', 'value', { shouldValidate: false, shouldDirty: false })
```
##### Removed
- remove `validationSchema` and embrace validation `resolver`
- remove `nest` option for `watch` & `getValues`, so data return from both methods will be in FormValues shape.
```diff
-getValues({ nest: true }); // { test: { data: 'test' }}
-watch({ nest: true }); // { test: { data: 'test' }}
+getValues(); // { test: { data: 'test' }}
+watch(); // { test: { data: 'test' }}
```
Configuration
:date: Schedule: At any time (no schedule defined).
:vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.
:recycle: Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
:no_bell: Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box.
This PR contains the following updates:
5.7.2
->6.15.6
Release Notes
react-hook-form/react-hook-form
### [`v6.15.6`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.15.6) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.15.5...v6.15.6) :beetle: fix [#4792](https://togithub.com/react-hook-form/react-hook-form/issues/4792) issue with nested field array append ### [`v6.15.5`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.15.5) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.15.4...v6.15.5) :beetle: fix issue with setInternalValue() for array values ([#4402](https://togithub.com/react-hook-form/react-hook-form/issues/4402)) :beetle: fix: prevent cloning objects for class-based instances ([#4400](https://togithub.com/react-hook-form/react-hook-form/issues/4400)) :beetle: fixing Field Array's remove function ([#4389](https://togithub.com/react-hook-form/react-hook-form/issues/4389)) ### [`v6.15.4`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.15.4) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.15.3...v6.15.4) :beetle: fix missing key for useFieldArray test :beetle: fix [#4259](https://togithub.com/react-hook-form/react-hook-form/issues/4259) correct unset on field array values ([#4262](https://togithub.com/react-hook-form/react-hook-form/issues/4262)) :beetle: fix [#4260](https://togithub.com/react-hook-form/react-hook-form/issues/4260) watch missing type for undefined as the first argument ([#4261](https://togithub.com/react-hook-form/react-hook-form/issues/4261)) ### [`v6.15.3`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.15.3) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.15.2...v6.15.3) :beetle: fix [#4251](https://togithub.com/react-hook-form/react-hook-form/issues/4251) issue with re-render during unmount field array ([#4252](https://togithub.com/react-hook-form/react-hook-form/issues/4252)) ๐๐ป fix: the issue of unmounted component trying to set state after reset for field arrays ([#4150](https://togithub.com/react-hook-form/react-hook-form/issues/4150)) ### [`v6.15.2`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.15.2) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.15.1...v6.15.2) :beetle: fix [#4219](https://togithub.com/react-hook-form/react-hook-form/issues/4219) Add default values when validating by using resolver ([#4229](https://togithub.com/react-hook-form/react-hook-form/issues/4229)) :beetle: fix [#4170](https://togithub.com/react-hook-form/react-hook-form/issues/4170) by removing field array [@useEffect](https://togithub.com/useEffect) with shouldUnregister ([#4172](https://togithub.com/react-hook-form/react-hook-form/issues/4172)) :beetle: fix [#4141](https://togithub.com/react-hook-form/react-hook-form/issues/4141) remove prod check at useEffect to fix dev/prod inconsistent behavior ([#4149](https://togithub.com/react-hook-form/react-hook-form/issues/4149)) ### [`v6.15.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.15.1) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.15.0...v6.15.1) :beetle: fix [#4084](https://togithub.com/react-hook-form/react-hook-form/issues/4084) useWatch react with typed value ([#4085](https://togithub.com/react-hook-form/react-hook-form/issues/4085)) ### [`v6.15.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#6150---2021-02-02) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.14.2...v6.15.0) ##### Changed - radio input default selection will return `null` instead of empty string `''` - `valueAsNumber` with empty input will return `NaN` instead of `0` ### [`v6.14.2`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.14.2) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.14.1...v6.14.2) :dart: close [#3908](https://togithub.com/react-hook-form/react-hook-form/issues/3908) with nested field value with deep equal ([#3910](https://togithub.com/react-hook-form/react-hook-form/issues/3910)) :beetle: fix [#3875](https://togithub.com/react-hook-form/react-hook-form/issues/3875) with nested useFieldArray remount ([#3900](https://togithub.com/react-hook-form/react-hook-form/issues/3900)) :martial_arts_uniform: fix [#3850](https://togithub.com/react-hook-form/react-hook-form/issues/3850) change method from pop to slice ([#3866](https://togithub.com/react-hook-form/react-hook-form/issues/3866)) ### [`v6.14.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.14.1) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.14.0...v6.14.1) :beetle: fix [#3851](https://togithub.com/react-hook-form/react-hook-form/issues/3851) with invalid formState type ([#3854](https://togithub.com/react-hook-form/react-hook-form/issues/3854)) :beetle: fix [#3834](https://togithub.com/react-hook-form/react-hook-form/issues/3834) dirty fields reset after input unmount with shouldUnregister: false :beetle: fix [#3819](https://togithub.com/react-hook-form/react-hook-form/issues/3819) issue with dirty fields during swop action ([#3824](https://togithub.com/react-hook-form/react-hook-form/issues/3824)) ### [`v6.14.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#6140---2020-12-31) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.13.1...v6.14.0) ##### Changed - `setValue` without shouldUnregister:false will no longer deep clone its value instead with shallow clone ##### Added - new formState `isValidating`, this will set to `true` during validation. ```ts const { formState: { isValidating }, } = useForm(); ``` ### [`v6.13.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.13.1) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.13.0...v6.13.1) :beetle: fix [#3689](https://togithub.com/react-hook-form/react-hook-form/issues/3689) missing id with nested child array ([#3690](https://togithub.com/react-hook-form/react-hook-form/issues/3690)) :beetle: fix [#3684](https://togithub.com/react-hook-form/react-hook-form/issues/3684) issue validate pattern with value as null ([#3685](https://togithub.com/react-hook-form/react-hook-form/issues/3685)) :package: close [#3677](https://togithub.com/react-hook-form/react-hook-form/issues/3677) improve setValue with field array ([#3688](https://togithub.com/react-hook-form/react-hook-form/issues/3688)) :face_with_rolling_eyes: close [#3664](https://togithub.com/react-hook-form/react-hook-form/issues/3664) with async useFieldArray remove ([#3665](https://togithub.com/react-hook-form/react-hook-form/issues/3665)) ### [`v6.13.0`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.13.0) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.12.2...v6.13.0) :star2: custom hook: useController ([#3488](https://togithub.com/react-hook-form/react-hook-form/issues/3488)) ```tsx import React from "react"; import { useController } from "react-hook-form"; function Input({ control, name }) { const { field, meta: { invalid, isTouched, isDirty }, } = useController({ name, control, rules: { required: true }, }); return ; } ``` ๐จ๐ปโ๐ป fix [#3613](https://togithub.com/react-hook-form/react-hook-form/issues/3613) `shouldUnregister:false` with `append` deep clone object ([#3614](https://togithub.com/react-hook-form/react-hook-form/issues/3614)) :beetle: fix [#3617](https://togithub.com/react-hook-form/react-hook-form/issues/3617) remove fields from append dep ([#3618](https://togithub.com/react-hook-form/react-hook-form/issues/3618)) ๐จ๐ปโ๐ป close [#3628](https://togithub.com/react-hook-form/react-hook-form/issues/3628) `reset` inconsistency with different `shouldUnregister` mode ([#3633](https://togithub.com/react-hook-form/react-hook-form/issues/3633)) :keyboard: fix [#3593](https://togithub.com/react-hook-form/react-hook-form/issues/3593) Map type for NestedValue ([#3616](https://togithub.com/react-hook-form/react-hook-form/issues/3616)) :crying_cat_face: [#1680](https://togithub.com/react-hook-form/react-hook-form/issues/1680) fix unmount warning on dev build ([#3645](https://togithub.com/react-hook-form/react-hook-form/issues/3645)) :ghost: fix [#3651](https://togithub.com/react-hook-form/react-hook-form/issues/3651) `setValue` with `shouldUnregister:false` with deep clone object ([#3652](https://togithub.com/react-hook-form/react-hook-form/issues/3652)) :robot_face: change from deepClone to shallowClone with defaultValues's reset ([#3607](https://togithub.com/react-hook-form/react-hook-form/issues/3607)) ### [`v6.12.2`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.12.2) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.12.1...v6.12.2) :beetle: fix 3577 issue with Controller register at FieldArray ([#3583](https://togithub.com/react-hook-form/react-hook-form/issues/3583)) :right-facing_fist: improve useFieldArray fast refresh ([#3576](https://togithub.com/react-hook-form/react-hook-form/issues/3576)) :beetle: fix input range max/min validation ([#3575](https://togithub.com/react-hook-form/react-hook-form/issues/3575)) :handshake: make cloneObject work in both Node & browsers ([#3571](https://togithub.com/react-hook-form/react-hook-form/issues/3571)) ### [`v6.12.1`](https://togithub.com/react-hook-form/react-hook-form/releases/v6.12.1) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.12.0...v6.12.1) :beetle: fix controller register issue with field array ([#3561](https://togithub.com/react-hook-form/react-hook-form/issues/3561)) :beetle: fix fast refresh ([#3559](https://togithub.com/react-hook-form/react-hook-form/issues/3559)) :beetle: fix [#3539](https://togithub.com/react-hook-form/react-hook-form/issues/3539) issue with JSX deepEqual ([#3558](https://togithub.com/react-hook-form/react-hook-form/issues/3558)) ๐จ๐ปโ๐ป improve DX with field array and fast refresh ([#3551](https://togithub.com/react-hook-form/react-hook-form/issues/3551)) ### [`v6.12.0`](https://togithub.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md#6120---2020-12-12) [Compare Source](https://togithub.com/react-hook-form/react-hook-form/compare/v6.11.5...v6.12.0) ##### Changed - When invoking `reset({ value })` value will be shallow clone value object which you have supplied instead of deepClone. ```tsx // :x: avoid the following with deep nested default values const defaultValues = { object: { deepNest: { file: new File() } } }; useForm({ defaultValues }); reset(defaultValues); // share the same reference // :white_check_mark: it's safer with the following, as we only doing shallow clone with defaultValues useForm({ deepNest: { file: new File() } }); reset({ deepNest: { file: new File() } }); ``` ##### Added - New custom hook `useController`: This custom hook is what powers Controller, and shares the same props and methods as Controller. It's useful to create reusable Controlled input, while Controller is the flexible option to drop into your page or form. ```tsx import React from 'react'; import { TextField } from '@material-ui/core'; import { useController } from 'react-hook-form'; function Input({ control, name }) { const { field: { ref, ...inputProps }, meta: { invalid, isTouched, isDirty }, } = useController({ name, control, rules: { required: true }, defaultValue: '', }); returnConfiguration
:date: Schedule: At any time (no schedule defined).
:vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.
:recycle: Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
:no_bell: Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.