New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@hashicorp/react-boolean-input

Package Overview
Dependencies
Maintainers
17
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hashicorp/react-boolean-input - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

12

dist/index.js

@@ -69,8 +69,13 @@ 'use strict';

// set up state for the input value
var _useState = React.useState(value || false),
var _useState = React.useState(false),
_useState2 = _slicedToArray(_useState, 2),
stateValue = _useState2[0],
setValue = _useState2[1]; // if the parent changes the value, reflect it to state
setValue = _useState2[1];
var _useState3 = React.useState(false),
_useState4 = _slicedToArray(_useState3, 2),
isDirty = _useState4[0],
setIsDirty = _useState4[1]; // if the parent changes the value, reflect it to state
React.useEffect(function () {

@@ -81,2 +86,4 @@ return setValue(value);

React.useEffect(function () {
// if the input hasn't been touched, don't pass up the value
if (!isDirty) return;
return onValueChange && onValueChange(stateValue);

@@ -98,2 +105,3 @@ }, [stateValue]); // generate a uid to pair the label to the input

onChange: function onChange(e) {
setIsDirty(true);
return setValue(e.target.checked);

@@ -100,0 +108,0 @@ }

4

package.json
{
"name": "@hashicorp/react-boolean-input",
"description": "A checkbox input",
"version": "1.0.2",
"version": "1.0.3",
"main": "dist",

@@ -18,3 +18,3 @@ "dependencies": {

},
"gitHead": "2f16ae732cb52aebad1e0e533952c6b526ac7701"
"gitHead": "ec287ce1525fcf8d4bd84969367e55711cad9cbb"
}
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