Skip to content

Commit

Permalink
Fix red screen due to ref being undefined
Browse files Browse the repository at this point in the history
This fixes the error
`undefined is not an object (evaluating 'this.refs[NATIVE_REF].setNativeProps')`.
  • Loading branch information
thomdixon committed Apr 5, 2016
1 parent 3874c01 commit 54699be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Libraries/PullToRefresh/PullToRefreshViewAndroid.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var PullToRefreshViewAndroid = React.createClass({
},

setNativeProps: function(props) {
return this.refs[NATIVE_REF].setNativeProps(props);
return this.getInnerViewNode().setNativeProps(props);
},

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

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

Expand Down

0 comments on commit 54699be

Please sign in to comment.