The pull-to-refresh view component for React Native
in Cli
npm i react-native-pull-to-refresh --save
in JavaScript
import PTRView from 'react-native-pull-to-refresh';
var PullToRefreshProject = React.createClass({
_refresh: function() {
return new Promise((resolve) => {
setTimeout(()=>{resolve()}, 2000)
});
},
render: function() {
return (
<PTRView onRefresh={this._refresh} >
<View style={styles.container}>
<Text style={styles.welcome}>
Let's Pull!
</Text>
</View>
</PTRView>
);
},
});
The method of refresh. You have to return promise object.
delay time of refresh
distance of pull to refresh
The background color of the refresh indicator
The background color of the refresh indicator
Welcome :)
MIT


