@aiszlab/relax 2.0.6-beta.8 → 2.0.6-beta.9
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.
|
@@ -27,12 +27,12 @@ function useControlledState(controlledState) {
|
|
|
27
27
|
_setState = _useState2[1];
|
|
28
28
|
// sync value back to `undefined` when it from control to un-control
|
|
29
29
|
useUpdateEffect.useUpdateEffect(function () {
|
|
30
|
-
if (!isUndefined.isUndefined(controlledState)) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
30
|
if (controlledState !== _state) {
|
|
34
31
|
onUpdate === null || onUpdate === void 0 || onUpdate(controlledState, _state);
|
|
35
32
|
}
|
|
33
|
+
if (!isUndefined.isUndefined(controlledState)) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
36
|
_setState(defaultState !== null && defaultState !== void 0 ? defaultState : controlledState);
|
|
37
37
|
}, [controlledState]);
|
|
38
38
|
// use controlled
|
|
@@ -25,12 +25,12 @@ function useControlledState(controlledState) {
|
|
|
25
25
|
_setState = _useState2[1];
|
|
26
26
|
// sync value back to `undefined` when it from control to un-control
|
|
27
27
|
useUpdateEffect(function () {
|
|
28
|
-
if (!isUndefined(controlledState)) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
28
|
if (controlledState !== _state) {
|
|
32
29
|
onUpdate === null || onUpdate === void 0 || onUpdate(controlledState, _state);
|
|
33
30
|
}
|
|
31
|
+
if (!isUndefined(controlledState)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
34
|
_setState(defaultState !== null && defaultState !== void 0 ? defaultState : controlledState);
|
|
35
35
|
}, [controlledState]);
|
|
36
36
|
// use controlled
|