react-hook-form 7.55.0-next.8 → 7.55.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/__typetest__/use-form-context.test-d.d.ts +2 -0
- package/dist/__typetest__/use-form-context.test-d.d.ts.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +9 -2
- 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/useFieldArray.d.ts.map +1 -1
- package/dist/useFormContext.d.ts +1 -1
- package/dist/useFormContext.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.mjs
CHANGED
@@ -2554,8 +2554,15 @@ function useFieldArray(props) {
|
|
2554
2554
|
React.useEffect(() => {
|
2555
2555
|
!get(control._formValues, name) && control._setFieldArray(name);
|
2556
2556
|
return () => {
|
2557
|
-
(
|
2558
|
-
control.
|
2557
|
+
const updateMounted = (name, value) => {
|
2558
|
+
const field = get(control._fields, name);
|
2559
|
+
if (field && field._f) {
|
2560
|
+
field._f.mount = value;
|
2561
|
+
}
|
2562
|
+
};
|
2563
|
+
control._options.shouldUnregister || shouldUnregister
|
2564
|
+
? control.unregister(name)
|
2565
|
+
: updateMounted(name, false);
|
2559
2566
|
};
|
2560
2567
|
}, [name, control, keyName, shouldUnregister]);
|
2561
2568
|
return {
|