diff --git a/index.js b/index.js index 3605f88bf8214d7df5288ec52e9e87b01557934b..98397b3c7527e6bed52ece5b0f06e6dba9e1873e 100644 --- a/index.js +++ b/index.js @@ -58,6 +58,10 @@ export default class PickerAny extends React.Component { this.setState(newState); } + shouldComponentUpdate(props, state, context){ + return JSON.stringify([props, state, context]) !== JSON.stringify([this.props, this.state, this.context]); + } + _getStateFromProps(props){ //the pickedValue must looks like [wheelone's, wheeltwo's, ...] //this.state.selectedValue may be the result of the first pickerWheel diff --git a/package.json b/package.json index 62b17ccfa09e63a60fe493f67984c0a59081876d..ce94eab8644279470bd64750b578660c56181000 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-picker", - "version": "0.2.8", + "version": "0.2.9", "description": "react-native-picker", "main": "index.js", "scripts": { @@ -19,7 +19,7 @@ "email": "wenliang.web@gmail.com" }, "dependencies": { - "react-native-picker-android": "~0.3.4" + "react-native-picker-android": "~0.3.5" }, "engines": { "node": ">=4"