Skip to content

Commit

Permalink
0.2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
xwenliang committed Jan 7, 2016
1 parent 1b7e249 commit e2a805e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,18 @@ 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]);
}
//todo
/*shouldComponentUpdate(props, state, context){
let newProps = Object.assign({}, props);
let newState = Object.assign({}, state);
let oldProps = Object.assign({}, this.props);
let oldState = Object.assign({}, this.state);
let arr = [newProps, newState, oldProps, oldState];
for(let i in arr){
delete arr[i].slideAnim;
}
return JSON.stringify([newProps, newState, context]) !== JSON.stringify([oldProps, oldState, this.context]);
}*/

_getStateFromProps(props){
//the pickedValue must looks like [wheelone's, wheeltwo's, ...]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-picker",
"version": "0.2.9",
"version": "0.2.10",
"description": "react-native-picker",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit e2a805e

Please sign in to comment.