react-hook-form 7.77.0 → 7.78.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.
@@ -1 +1 @@
1
- {"version":3,"file":"createFormControl.d.ts","sourceRoot":"","sources":["../../src/logic/createFormControl.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAcV,WAAW,EAiBX,YAAY,EAKZ,aAAa,EAYd,MAAM,UAAU,CAAC;AAuDlB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;CAY9B,CAAC;AAEF,wBAAgB,iBAAiB,CAC/B,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,QAAQ,GAAG,GAAG,EACd,kBAAkB,GAAG,YAAY,EAEjC,KAAK,GAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAM,GACnE,IAAI,CACL,aAAa,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EACzD,WAAW,CACZ,GAAG;IACF,WAAW,EAAE,IAAI,CACf,aAAa,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EACzD,WAAW,CACZ,CAAC;CACH,CAsvDA"}
1
+ {"version":3,"file":"createFormControl.d.ts","sourceRoot":"","sources":["../../src/logic/createFormControl.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAcV,WAAW,EAiBX,YAAY,EAKZ,aAAa,EAYd,MAAM,UAAU,CAAC;AAuDlB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;CAY9B,CAAC;AAEF,wBAAgB,iBAAiB,CAC/B,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,QAAQ,GAAG,GAAG,EACd,kBAAkB,GAAG,YAAY,EAEjC,KAAK,GAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAM,GACnE,IAAI,CACL,aAAa,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EACzD,WAAW,CACZ,GAAG;IACF,WAAW,EAAE,IAAI,CACf,aAAa,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EACzD,WAAW,CACZ,CAAC;CACH,CAyvDA"}
@@ -109,6 +109,7 @@ var createSubject = () => {
109
109
 
110
110
  var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
111
111
 
112
+ const isEmptyObjectWithCustomPrototype = (object, keys) => keys.length === 0 && !Array.isArray(object) && !isPlainObject(object);
112
113
  function deepEqual(object1, object2, visited = new WeakSet()) {
113
114
  if (object1 === object2) {
114
115
  return true;
@@ -124,6 +125,10 @@ function deepEqual(object1, object2, visited = new WeakSet()) {
124
125
  if (keys1.length !== keys2.length) {
125
126
  return false;
126
127
  }
128
+ if (isEmptyObjectWithCustomPrototype(object1, keys1) ||
129
+ isEmptyObjectWithCustomPrototype(object2, keys2)) {
130
+ return Object.is(object1, object2);
131
+ }
127
132
  if (visited.has(object1) || visited.has(object2)) {
128
133
  return true;
129
134
  }
@@ -1467,13 +1472,15 @@ function createFormControl(props = {}) {
1467
1472
  const { errors } = await _runSchema([name]);
1468
1473
  _updateIsValidating([name]);
1469
1474
  _updateIsFieldValueUpdated(fieldValue);
1470
- if (isFieldValueUpdated) {
1471
- const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);
1472
- const errorLookupResult = schemaErrorLookup(errors, _fields, previousErrorLookupResult.name || name);
1473
- error = errorLookupResult.error;
1474
- name = errorLookupResult.name;
1475
- isValid = isEmptyObject(errors);
1475
+ if (!isFieldValueUpdated) {
1476
+ !isEmptyObject(fieldState) && _subjects.state.next(fieldState);
1477
+ return;
1476
1478
  }
1479
+ const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);
1480
+ const errorLookupResult = schemaErrorLookup(errors, _fields, previousErrorLookupResult.name || name);
1481
+ error = errorLookupResult.error;
1482
+ name = errorLookupResult.name;
1483
+ isValid = isEmptyObject(errors);
1477
1484
  }
1478
1485
  else {
1479
1486
  _updateIsValidating([name], true);