@sheinx/hooks 3.4.4-beta.2 → 3.4.4-beta.4
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/cjs/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
- package/cjs/components/use-form/use-form-control/use-form-control.js +5 -1
- package/esm/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
- package/esm/components/use-form/use-form-control/use-form-control.js +5 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAyB/D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;
|
1
|
+
{"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAyB/D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;kBAuHpC,CAAC,YAAY,GAAG,EAAE;;;;;EAiDrD"}
|
@@ -103,7 +103,11 @@ function useFormControl(props) {
|
|
103
103
|
setErrorState(error);
|
104
104
|
}
|
105
105
|
if (!(0, _shallowEqual.shallowEqual)(value, latestInfo.valueState)) {
|
106
|
-
|
106
|
+
if (value === undefined && defaultValue !== undefined) {
|
107
|
+
setValueState(defaultValue);
|
108
|
+
} else {
|
109
|
+
setValueState(value);
|
110
|
+
}
|
107
111
|
latestInfo.valueState = value;
|
108
112
|
}
|
109
113
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAyB/D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;
|
1
|
+
{"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAyB/D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;kBAuHpC,CAAC,YAAY,GAAG,EAAE;;;;;EAiDrD"}
|
@@ -94,7 +94,11 @@ export default function useFormControl(props) {
|
|
94
94
|
setErrorState(error);
|
95
95
|
}
|
96
96
|
if (!shallowEqual(value, latestInfo.valueState)) {
|
97
|
-
|
97
|
+
if (value === undefined && defaultValue !== undefined) {
|
98
|
+
setValueState(defaultValue);
|
99
|
+
} else {
|
100
|
+
setValueState(value);
|
101
|
+
}
|
98
102
|
latestInfo.valueState = value;
|
99
103
|
}
|
100
104
|
});
|