awing-library 2.1.180-dev → 2.1.181-dev

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.
@@ -65,6 +65,7 @@ var BasicDataForm = function (props) {
65
65
  var _b = react_1.default.useState(function () {
66
66
  return getCurrentObj({ oldValue: oldValue, fields: fields });
67
67
  }), currentObj = _b[0], setCurrentObj = _b[1];
68
+ var renderCount = react_1.default.useRef(0);
68
69
  var _c = react_1.default.useState({}), currentValid = _c[0], setCurrentValid = _c[1];
69
70
  var errorText = react_1.default.useRef({
70
71
  default: t('Common.InvalidData'),
@@ -100,7 +101,7 @@ var BasicDataForm = function (props) {
100
101
  : (0, exports.DefaultCheckValid)(fieldType, value);
101
102
  };
102
103
  react_1.default.useEffect(function () {
103
- if (oldValue) {
104
+ if (oldValue && renderCount.current !== 0) {
104
105
  setCurrentObj(getCurrentObj({ oldValue: oldValue, fields: fields }));
105
106
  var valid = {};
106
107
  for (var i = 0; i < fields.length; i++) {
@@ -109,6 +110,7 @@ var BasicDataForm = function (props) {
109
110
  }
110
111
  setCurrentValid(valid);
111
112
  }
113
+ renderCount.current += 1;
112
114
  // eslint-disable-next-line react-hooks/exhaustive-deps
113
115
  }, []);
114
116
  var handleChange = function (fieldName, fieldValue) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.180-dev",
3
+ "version": "2.1.181-dev",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",