react-hook-form 7.22.2 → 7.22.3
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 +4 -7
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.mjs
CHANGED
@@ -235,14 +235,11 @@ function useController(props) {
|
|
235
235
|
updateMounted(name, true);
|
236
236
|
return () => {
|
237
237
|
const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
|
238
|
-
|
238
|
+
isArrayField
|
239
239
|
? _shouldUnregisterField && !control._stateFlags.action
|
240
|
-
: _shouldUnregisterField
|
241
|
-
|
242
|
-
|
243
|
-
else {
|
244
|
-
updateMounted(name, false);
|
245
|
-
}
|
240
|
+
: _shouldUnregisterField
|
241
|
+
? control.unregister(name)
|
242
|
+
: updateMounted(name, false);
|
246
243
|
};
|
247
244
|
}, [name, control, isArrayField, shouldUnregister]);
|
248
245
|
return {
|