react-hook-form 7.55.0-next.4 → 7.55.0-next.5

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.
@@ -1696,8 +1696,10 @@ function createFormControl(props = {}) {
1696
1696
  });
1697
1697
  if (shouldSkipValidation) {
1698
1698
  if (_proxyFormState.isValid || _proxySubscribeFormState.isValid) {
1699
- if (_options.mode === 'onBlur' && isBlurEvent) {
1700
- _setValid();
1699
+ if (_options.mode === 'onBlur') {
1700
+ if (isBlurEvent) {
1701
+ _setValid();
1702
+ }
1701
1703
  }
1702
1704
  else if (!isBlurEvent) {
1703
1705
  _setValid();
@@ -2657,7 +2659,7 @@ function useForm(props = {}) {
2657
2659
  }
2658
2660
  }, [props.values, control]);
2659
2661
  React.useEffect(() => {
2660
- if (props.errors) {
2662
+ if (props.errors && !isEmptyObject(props.errors)) {
2661
2663
  control._setErrors(props.errors);
2662
2664
  }
2663
2665
  }, [props.errors, control]);