File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,21 @@ export default class PickerAndroid extends React.Component{
5252 this . setState ( this . _stateFromProps ( nextProps ) ) ;
5353 }
5454
55- shouldComponentUpdate ( props , state , context ) {
55+ shouldComponentUpdate ( nextProps , nextState , context ) {
5656 //JSON.stringify(props) cause error "Converting circular structure to JSON"
57- return JSON . stringify ( [ state , context ] ) !== JSON . stringify ( [ this . state , this . context ] ) ;
57+ return JSON . stringify ( [ {
58+ selectedIndex : nextState . selectedIndex ,
59+ items : nextState . items ,
60+ pickerStyle : nextState . pickerStyle ,
61+ itemStyle : nextState . itemStyle ,
62+ onValueChange : nextState . onValueChange
63+ } , context ] ) !== JSON . stringify ( [ {
64+ selectedIndex : this . state . selectedIndex ,
65+ items : this . state . items ,
66+ pickerStyle : this . state . pickerStyle ,
67+ itemStyle : this . state . itemStyle ,
68+ onValueChange : this . state . onValueChange
69+ } , this . context ] ) ;
5870 }
5971
6072 _stateFromProps ( props ) {
Original file line number Diff line number Diff line change 11{
22 "name" : " react-native-picker-android" ,
3- "version" : " 0.3.6 " ,
3+ "version" : " 0.3.7 " ,
44 "description" : " react-native-picker-android" ,
55 "main" : " index.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments