Skip to content

Commit 68b30cb

Browse files
committed
add shouldupdate detect
1 parent b1f0f9e commit 68b30cb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ export default class PickerAndroid extends React.Component{
5252
this.setState(this._stateFromProps(nextProps));
5353
}
5454

55+
shouldComponentUpdate(props, state, context){
56+
return JSON.stringify([props, state, context]) !== JSON.stringify([this.props, this.state, this.context]);
57+
}
58+
5559
_stateFromProps(props){
5660
let selectedIndex = 0;
5761
let items = [];

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-picker-android",
3-
"version": "0.3.4",
3+
"version": "0.3.5",
44
"description": "react-native-picker-android",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)