@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.
@@ -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;;kBAmHpC,CAAC,YAAY,GAAG,EAAE;;;;;EAiDrD"}
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
- setValueState(value);
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;;kBAmHpC,CAAC,YAAY,GAAG,EAAE;;;;;EAiDrD"}
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
- setValueState(value);
97
+ if (value === undefined && defaultValue !== undefined) {
98
+ setValueState(defaultValue);
99
+ } else {
100
+ setValueState(value);
101
+ }
98
102
  latestInfo.valueState = value;
99
103
  }
100
104
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.4.4-beta.2",
3
+ "version": "3.4.4-beta.4",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",