最近才发现的插件, 感觉不错
安装
npm install react-pull-to-refresh
使用
handleRefresh(resolve, reject) {
// do some async code here
if (success) {
resolve();
} else {
reject();
}
}
<ReactPullToRefresh
onRefresh={this.handleRefresh}
className="your-own-class-if-you-want"
style={{
textAlign: 'center'
}}>
<h3>Pull down to refresh</h3>
<div>{items}</div>
<div>etc.</div>
</ReactPullToRefresh>
github
https://github.com/bryaneaton13/react-pull-to-refresh