react-hook-form 7.32.1 → 7.32.2

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.
@@ -1439,10 +1439,12 @@ function createFormControl(props = {}) {
1439
1439
  set(_formValues, name, values);
1440
1440
  }
1441
1441
  };
1442
- const updateErrors = (name, error) => (set(_formState.errors, name, error),
1442
+ const updateErrors = (name, error) => {
1443
+ set(_formState.errors, name, error);
1443
1444
  _subjects.state.next({
1444
1445
  errors: _formState.errors,
1445
- }));
1446
+ });
1447
+ };
1446
1448
  const updateValidAndValue = (name, shouldSkipSetValueAs, value, ref) => {
1447
1449
  const field = get(_fields, name);
1448
1450
  if (field) {
@@ -1492,8 +1494,7 @@ function createFormControl(props = {}) {
1492
1494
  const previousFieldError = get(_formState.errors, name);
1493
1495
  const shouldUpdateValid = _proxyFormState.isValid && _formState.isValid !== isValid;
1494
1496
  if (props.delayError && error) {
1495
- delayErrorCallback =
1496
- delayErrorCallback || debounce(() => updateErrors(name, error));
1497
+ delayErrorCallback = debounce(() => updateErrors(name, error));
1497
1498
  delayErrorCallback(props.delayError);
1498
1499
  }
1499
1500
  else {