@sheinx/hooks 3.1.11 → 3.1.13
Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,6 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
26
26
|
var globalKey = '__global__&&@@';
|
27
27
|
var emptyObj = {};
|
28
28
|
var useForm = function useForm(props) {
|
29
|
-
var _props$value;
|
30
29
|
var _props$defaultValue = props.defaultValue,
|
31
30
|
defaultValue = _props$defaultValue === void 0 ? {} : _props$defaultValue,
|
32
31
|
labelWidth = props.labelWidth,
|
@@ -58,7 +57,7 @@ var useForm = function useForm(props) {
|
|
58
57
|
removeArr: new Set(),
|
59
58
|
names: new Set(),
|
60
59
|
submitLock: false,
|
61
|
-
value: (
|
60
|
+
value: (0, _utils.deepClone)(props.value) || emptyObj,
|
62
61
|
errors: {},
|
63
62
|
serverErrors: {},
|
64
63
|
lastValue: props.value || emptyObj,
|
@@ -17,7 +17,6 @@ import { current, produce } from "../../utils/immer";
|
|
17
17
|
import { deepGet, deepRemove, deepSet, docScroll, extractEventHandlers, isArray, isObject, shallowEqual, wrapFormError, deepClone } from "../../utils";
|
18
18
|
var emptyObj = {};
|
19
19
|
var useForm = function useForm(props) {
|
20
|
-
var _props$value;
|
21
20
|
var _props$defaultValue = props.defaultValue,
|
22
21
|
defaultValue = _props$defaultValue === void 0 ? {} : _props$defaultValue,
|
23
22
|
labelWidth = props.labelWidth,
|
@@ -49,7 +48,7 @@ var useForm = function useForm(props) {
|
|
49
48
|
removeArr: new Set(),
|
50
49
|
names: new Set(),
|
51
50
|
submitLock: false,
|
52
|
-
value:
|
51
|
+
value: deepClone(props.value) || emptyObj,
|
53
52
|
errors: {},
|
54
53
|
serverErrors: {},
|
55
54
|
lastValue: props.value || emptyObj,
|