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

react-native-picker-select

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-picker-select - npm Package Compare versions

Comparing version 5.2.1 to 5.2.2

6

CHANGELOG.md

@@ -0,1 +1,7 @@

### v5.2.2
##### Bugfix
- Fixes unnecessary renders (#129)
### v5.2.1

@@ -2,0 +8,0 @@

2

package.json
{
"name": "react-native-picker-select",
"version": "5.2.1",
"version": "5.2.2",
"description": "A Picker component for React Native which emulates the native <select> interfaces for each platform",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -113,10 +113,11 @@ import React, { PureComponent } from 'react';

static getDerivedStateFromProps(nextProps, prevState) {
// update items if items prop changes
const itemsChanged = !isEqual(prevState.items, nextProps.items);
// update selectedItem if value prop is defined and differs from currently selected item
const newItems = RNPickerSelect.handlePlaceholder({
// update items if items or placeholder prop changes
const items = RNPickerSelect.handlePlaceholder({
placeholder: nextProps.placeholder,
}).concat(nextProps.items);
const itemsChanged = !isEqual(prevState.items, items);
// update selectedItem if value prop is defined and differs from currently selected item
const { selectedItem, idx } = RNPickerSelect.getSelectedItem({
items: newItems,
items,
key: nextProps.itemKey,

@@ -132,5 +133,6 @@ value: nextProps.value,

}
return {
items: itemsChanged ? newItems : prevState.items,
selectedItem: selectedItemChanged ? selectedItem : prevState.selectedItem,
...(itemsChanged && { items }),
...(selectedItemChanged && { selectedItem }),
};

@@ -137,0 +139,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