@clayui/shared
Advanced tools
Comparing version 3.36.0 to 3.37.0
@@ -6,2 +6,8 @@ # Change Log | ||
# [3.37.0](https://github.com/liferay/clay/compare/v3.36.0...v3.37.0) (2021-10-06) | ||
### Bug Fixes | ||
- **@clayui/shared:** fix error when controlling internal state using external value and internal controller ([d17eba5](https://github.com/liferay/clay/commit/d17eba5)) | ||
# [3.36.0](https://github.com/liferay/clay/compare/v3.35.3...v3.36.0) (2021-09-23) | ||
@@ -8,0 +14,0 @@ |
@@ -33,3 +33,3 @@ "use strict"; | ||
var _React$useState = React.useState(initialValue), | ||
var _React$useState = React.useState(initialValue !== null && initialValue !== void 0 ? initialValue : value), | ||
_React$useState2 = _slicedToArray(_React$useState, 2), | ||
@@ -39,7 +39,4 @@ internalValue = _React$useState2[0], | ||
if (typeof value === 'undefined') { | ||
if (typeof value === 'undefined' || typeof onChange === 'undefined') { | ||
value = internalValue; | ||
} | ||
if (typeof onChange === 'undefined') { | ||
onChange = setInternalValue; | ||
@@ -46,0 +43,0 @@ } |
{ | ||
"name": "@clayui/shared", | ||
"version": "3.36.0", | ||
"version": "3.37.0", | ||
"description": "ClayShared component", | ||
@@ -29,4 +29,4 @@ "license": "BSD-3-Clause", | ||
"dependencies": { | ||
"@clayui/button": "^3.32.0", | ||
"@clayui/link": "^3.32.0", | ||
"@clayui/button": "^3.37.0", | ||
"@clayui/link": "^3.37.0", | ||
"classnames": "^2.2.6", | ||
@@ -37,3 +37,3 @@ "dom-align": "^1.10.2" | ||
"@clayui/css": "3.x", | ||
"@clayui/provider": "^3.36.0", | ||
"@clayui/provider": "^3.37.0", | ||
"react": "^16.12.0", | ||
@@ -45,3 +45,3 @@ "react-dom": "^16.12.0" | ||
], | ||
"gitHead": "e91895f788381be22112ad3e98a755a7992ff448" | ||
"gitHead": "0079c5f752a4c2fd2885e507d466bfd63fe57a9f" | ||
} |
@@ -24,9 +24,8 @@ /** | ||
}: IArgs<TValue>) { | ||
const [internalValue, setInternalValue] = React.useState(initialValue); | ||
const [internalValue, setInternalValue] = React.useState( | ||
initialValue ?? value | ||
); | ||
if (typeof value === 'undefined') { | ||
if (typeof value === 'undefined' || typeof onChange === 'undefined') { | ||
value = internalValue; | ||
} | ||
if (typeof onChange === 'undefined') { | ||
onChange = setInternalValue; | ||
@@ -33,0 +32,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90045
2069
Updated@clayui/button@^3.37.0
Updated@clayui/link@^3.37.0