react-hook-form 7.63.0 → 7.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +1 -3
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/path/eager.d.ts +1 -1
- package/dist/types/path/eager.d.ts.map +1 -1
- package/dist/useController.d.ts.map +1 -1
- package/dist/useFieldArray.d.ts.map +1 -1
- package/package.json +18 -19
package/dist/index.esm.mjs
CHANGED
|
@@ -507,7 +507,7 @@ function useController(props) {
|
|
|
507
507
|
};
|
|
508
508
|
updateMounted(name, true);
|
|
509
509
|
if (_shouldUnregisterField) {
|
|
510
|
-
const value = cloneObject(get(control._options.defaultValues, name));
|
|
510
|
+
const value = cloneObject(get(control._options.defaultValues, name, _props.current.defaultValue));
|
|
511
511
|
set(control._defaultValues, name, value);
|
|
512
512
|
if (isUndefined(get(control._formValues, name))) {
|
|
513
513
|
set(control._formValues, name, value);
|
|
@@ -2460,9 +2460,7 @@ function useFieldArray(props) {
|
|
|
2460
2460
|
const { control = methods.control, name, keyName = 'id', shouldUnregister, rules, } = props;
|
|
2461
2461
|
const [fields, setFields] = React.useState(control._getFieldArray(name));
|
|
2462
2462
|
const ids = React.useRef(control._getFieldArray(name).map(generateId));
|
|
2463
|
-
const _fieldIds = React.useRef(fields);
|
|
2464
2463
|
const _actioned = React.useRef(false);
|
|
2465
|
-
_fieldIds.current = fields;
|
|
2466
2464
|
control._names.array.add(name);
|
|
2467
2465
|
React.useMemo(() => rules &&
|
|
2468
2466
|
control.register(name, rules), [control, rules, name]);
|