@sheinx/hooks 3.1.10 → 3.1.11
Sign up to get free protection for your applications and to get access to all the features.
@@ -26,6 +26,7 @@ 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;
|
29
30
|
var _props$defaultValue = props.defaultValue,
|
30
31
|
defaultValue = _props$defaultValue === void 0 ? {} : _props$defaultValue,
|
31
32
|
labelWidth = props.labelWidth,
|
@@ -57,7 +58,7 @@ var useForm = function useForm(props) {
|
|
57
58
|
removeArr: new Set(),
|
58
59
|
names: new Set(),
|
59
60
|
submitLock: false,
|
60
|
-
value: props.value || emptyObj,
|
61
|
+
value: ((_props$value = props.value) !== null && _props$value !== void 0 ? _props$value : (0, _utils.deepClone)(props.value)) || emptyObj,
|
61
62
|
errors: {},
|
62
63
|
serverErrors: {},
|
63
64
|
lastValue: props.value || emptyObj,
|
@@ -17,6 +17,7 @@ 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;
|
20
21
|
var _props$defaultValue = props.defaultValue,
|
21
22
|
defaultValue = _props$defaultValue === void 0 ? {} : _props$defaultValue,
|
22
23
|
labelWidth = props.labelWidth,
|
@@ -48,7 +49,7 @@ var useForm = function useForm(props) {
|
|
48
49
|
removeArr: new Set(),
|
49
50
|
names: new Set(),
|
50
51
|
submitLock: false,
|
51
|
-
value: props.value || emptyObj,
|
52
|
+
value: ((_props$value = props.value) !== null && _props$value !== void 0 ? _props$value : deepClone(props.value)) || emptyObj,
|
52
53
|
errors: {},
|
53
54
|
serverErrors: {},
|
54
55
|
lastValue: props.value || emptyObj,
|