Skip to content

Commit

Permalink
Move ref check to setNativeProps from _onRefresh
Browse files Browse the repository at this point in the history
As requested by @satya164 :)
  • Loading branch information
thomdixon committed Apr 5, 2016
1 parent 54699be commit ed787ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Libraries/PullToRefresh/PullToRefreshViewAndroid.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ var PullToRefreshViewAndroid = React.createClass({
},

setNativeProps: function(props) {
return this.getInnerViewNode().setNativeProps(props);
let innerViewNode = this.getInnerViewNode();
return innerViewNode && innerViewNode.setNativeProps(props);
},

render: function() {
Expand All @@ -88,7 +89,7 @@ var PullToRefreshViewAndroid = React.createClass({

_onRefresh: function() {
this.props.onRefresh && this.props.onRefresh();
this.getInnerViewNode() && this.setNativeProps({refreshing: !!this.props.refreshing});
this.setNativeProps({refreshing: !!this.props.refreshing});
}
});

Expand Down

0 comments on commit ed787ab

Please sign in to comment.