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.
- package/README.md +12 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +5 -3
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/logic/createFormControl.d.ts.map +1 -1
- package/dist/react-server.esm.mjs +4 -2
- package/dist/react-server.esm.mjs.map +1 -1
- package/dist/useForm.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.mjs
CHANGED
@@ -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'
|
1700
|
-
|
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]);
|