Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@clayui/shared

Package Overview
Dependencies
Maintainers
16
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clayui/shared - npm Package Compare versions

Comparing version 3.36.0 to 3.37.0

6

CHANGELOG.md

@@ -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 @@

7

lib/useInternalState.js

@@ -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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc