0.0.3 • Published 5 years ago

react-native-customizable-refresh-control-view v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

React Native Refresh Control View

npm version

Let you have ability to customize refresh control.

NOT READY YET

DEMO

Install

  # peer dependency. Please follow react-native-gesture-handler's guide to setup it.
  yarn add react-native-gesture-handler
  yarn add react-native-customizable-refresh-control-view

Usage

import React from 'react';
import { Text } from 'react-native';
import { ScrollView } from 'react-native-customizable-refresh-control-view';

class RefreshControl extends React.Component {
  render() {
    return <Text>Refreshing...</Text>;
  }
}

class ReactComponent extends React.Component {
  handlePullRefresh = () => {
    // refreshing, you can return promise here.
  };

  render() {
    return (
      <ScrollView
        onPullRefresh={this.handlePullRefresh}
        minRefreshDistance={100}
        RefreshControl={RefreshControl}
      >
        ...content
      </ScrollView>
    );
  }
}