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

react-select-search

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-select-search - npm Package Compare versions

Comparing version 3.0.3 to 3.0.5

8

dist/cjs/lib/getOptions.js

@@ -14,3 +14,9 @@ "use strict";

if (!multiple) {
return (0, _getOption["default"])(value, options) || oldValue;
var newOption = (0, _getOption["default"])(value, options);
if (newOption) {
return newOption;
}
return oldValue;
}

@@ -17,0 +23,0 @@

@@ -50,2 +50,3 @@ "use strict";

var ref = (0, _react.useRef)(null);
var valueRef = (0, _react.useRef)(undefined);

@@ -134,2 +135,7 @@ var _useState = (0, _react.useState)(null),

(0, _react.useEffect)(function () {
if (valueRef.current === defaultValue) {
return;
}
valueRef.current = defaultValue;
setValue((0, _getOptions["default"])(defaultValue, null, options, multiple));

@@ -136,0 +142,0 @@ }, [defaultValue, multiple, options]);

@@ -5,3 +5,9 @@ import valueToArray from './valuteToArray';

if (!multiple) {
return getOption(value, options) || oldValue;
const newOption = getOption(value, options);
if (newOption) {
return newOption;
}
return oldValue;
}

@@ -8,0 +14,0 @@

@@ -25,2 +25,3 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

const ref = useRef(null);
const valueRef = useRef(undefined);
const [value, setValue] = useState(null);

@@ -88,2 +89,7 @@ const [search, setSearch] = useState('');

useEffect(() => {
if (valueRef.current === defaultValue) {
return;
}
valueRef.current = defaultValue;
setValue(getOptions(defaultValue, null, options, multiple));

@@ -90,0 +96,0 @@ }, [defaultValue, multiple, options]);

2

package.json
{
"name": "react-select-search",
"version": "3.0.3",
"version": "3.0.5",
"description": "Lightweight select component for React",

@@ -5,0 +5,0 @@ "main": "dist/esm/index.js",

@@ -7,3 +7,3 @@ <p align="center">

<a href="https://www.npmjs.com/package/react-select-search">
<img src="https://travis-ci.org/tbleckert/react-select-search.svg?branch=master" style="max-width:100%;" />
<img src="https://travis-ci.org/tbleckert/react-select-search.svg?branch=main" style="max-width:100%;" />
</a>

@@ -10,0 +10,0 @@ <a href='https://coveralls.io/github/tbleckert/react-select-search'>

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