react-hook-form 7.55.0-next.2 → 7.55.0-next.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.
@@ -214,7 +214,6 @@ var set = (object, path, value) => {
214
214
  object[key] = newValue;
215
215
  object = object[key];
216
216
  }
217
- return object;
218
217
  };
219
218
 
220
219
  function baseGet(object, updatePath) {
@@ -1105,7 +1104,7 @@ function createFormControl(props = {}) {
1105
1104
  if (!fieldReference.ref.type) {
1106
1105
  _subjects.state.next({
1107
1106
  name,
1108
- values: { ..._formValues },
1107
+ values: cloneObject(_formValues),
1109
1108
  });
1110
1109
  }
1111
1110
  }
@@ -1136,7 +1135,7 @@ function createFormControl(props = {}) {
1136
1135
  if (isFieldArray) {
1137
1136
  _subjects.array.next({
1138
1137
  name,
1139
- values: { ..._formValues },
1138
+ values: cloneObject(_formValues),
1140
1139
  });
1141
1140
  if ((_proxyFormState.isDirty ||
1142
1141
  _proxyFormState.dirtyFields ||
@@ -1158,7 +1157,7 @@ function createFormControl(props = {}) {
1158
1157
  isWatched(name, _names) && _subjects.state.next({ ..._formState });
1159
1158
  _subjects.state.next({
1160
1159
  name: _state.mount ? name : undefined,
1161
- values: { ..._formValues },
1160
+ values: cloneObject(_formValues),
1162
1161
  });
1163
1162
  };
1164
1163
  const onChange = async (event) => {
@@ -1200,7 +1199,7 @@ function createFormControl(props = {}) {
1200
1199
  _subjects.state.next({
1201
1200
  name,
1202
1201
  type: event.type,
1203
- values: { ..._formValues },
1202
+ values: cloneObject(_formValues),
1204
1203
  });
1205
1204
  if (shouldSkipValidation) {
1206
1205
  if (_proxyFormState.isValid || _proxySubscribeFormState.isValid) {
@@ -1341,7 +1340,7 @@ function createFormControl(props = {}) {
1341
1340
  if (shouldSubscribeByName(props.name, formState.name, props.exact) &&
1342
1341
  shouldRenderFormState(formState, props.formState || _proxyFormState, _setFormState, props.reRenderRoot)) {
1343
1342
  props.callback({
1344
- values: _formValues,
1343
+ values: { ..._formValues },
1345
1344
  ..._formState,
1346
1345
  ...formState,
1347
1346
  });
@@ -1377,7 +1376,7 @@ function createFormControl(props = {}) {
1377
1376
  unset(_defaultValues, fieldName);
1378
1377
  }
1379
1378
  _subjects.state.next({
1380
- values: { ..._formValues },
1379
+ values: cloneObject(_formValues),
1381
1380
  });
1382
1381
  _subjects.state.next({
1383
1382
  ..._formState,