Skip to content

erenn16/react-native-pull-to-refresh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-pull-to-refresh (iOS/Android)

The pull-to-refresh view component for React Native

npmnpm

NPM

js-standard-style forthebadge

Demo

demo demo

Installation

in Cli

npm i react-native-pull-to-refresh --save

in JavaScript

import PTRView from 'react-native-pull-to-refresh';

Usage

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>
    );
  },
});

Props

onRefresh

The method of refresh. You have to return promise object.

delay(defalt:0)

delay time of refresh

offset(defalt:80) iOS

distance of pull to refresh

colors(defalt:#000) Android

The background color of the refresh indicator

progressBackgroundColor(defalt:transparent) Android

The background color of the refresh indicator

Contributing

Welcome :)

License

MIT

About

The Pull-To-Refres component for React Native (iOS/Android)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 53.9%
  • Objective-C 31.6%
  • Java 14.5%