diff --git a/lib/RefresherListView.js b/lib/RefresherListView.js index 7231f07..adbc818 100644 --- a/lib/RefresherListView.js +++ b/lib/RefresherListView.js @@ -102,8 +102,10 @@ class RefresherListView extends React.Component { let threshold = Math.max(Math.min(-offsetY/this.getIndicatorHeight(),1),0); let status = (threshold>=this.state.threshold&&!listviewscroll.scrollResponderIsAnimating()||this.scrolling)?'pull':null; - this.state.loadingStatus = status; - this.state.threshold = threshold; + this.setState({ + loadingStatus: status, + threshold: threshold, + }) changeProps(this.refs.indicator, {threshold, status}); this.lastOffsetY = offsetY; @@ -150,8 +152,10 @@ class RefresherListView extends React.Component { this.updateUIThreshold(this.getIndicatorHeight()); - this.state.loadingStatus = 'loading'; - this.state.threshold = 1; + this.setState({ + loadingStatus: 'loading', + threshold: 1, + }) changeProps(this.refs.indicator, {status: this.state.loadingStatus, threshold:this.state.threshold});