Commit 1b7e249c authored by xwenliang's avatar xwenliang

add shouldupdate detect

parent ddec3ff0
...@@ -58,6 +58,10 @@ export default class PickerAny extends React.Component { ...@@ -58,6 +58,10 @@ export default class PickerAny extends React.Component {
this.setState(newState); this.setState(newState);
} }
shouldComponentUpdate(props, state, context){
return JSON.stringify([props, state, context]) !== JSON.stringify([this.props, this.state, this.context]);
}
_getStateFromProps(props){ _getStateFromProps(props){
//the pickedValue must looks like [wheelone's, wheeltwo's, ...] //the pickedValue must looks like [wheelone's, wheeltwo's, ...]
//this.state.selectedValue may be the result of the first pickerWheel //this.state.selectedValue may be the result of the first pickerWheel
......
{ {
"name": "react-native-picker", "name": "react-native-picker",
"version": "0.2.8", "version": "0.2.9",
"description": "react-native-picker", "description": "react-native-picker",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"email": "wenliang.web@gmail.com" "email": "wenliang.web@gmail.com"
}, },
"dependencies": { "dependencies": {
"react-native-picker-android": "~0.3.4" "react-native-picker-android": "~0.3.5"
}, },
"engines": { "engines": {
"node": ">=4" "node": ">=4"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment