@chainplatform/pull-to-refresh

0.2.8 • Public • Published

@chainplatform/pull-to-refresh

React Native Pull To Refresh for React Native and React Native Web, support ScrollView and FlatList. Bring Pull To Refresh to Website.

Current npm package version. PRs welcome! Follow @doansan

Install

npm install @chainplatform/pull-to-refresh --save

or

yarn add @chainplatform/pull-to-refresh

Usage

props:

  • support full FlatList and ScrollView props

Example

import React from 'react';
import {StyleSheet} from 'react-native';
import ChainScrollView from '@chainplatform/pull-to-refresh';

class App extends React.Component {

onRefresh() {
  this.setState({refreshing: true});
}

  render() {
    return (
      <View style={{flex:1}}>
          <ChainScrollView
                    ref={this.ref}
                    testID={"scroll_view"}
                    style={{ flexGrow: 1, flexBasis: 0, padding: 15 }}
                    scrollEventThrottle={16}
                    bounces={false}
                    overScrollMode="never"
                    scrollEnabled={true}
                    bouncesZoom={false}
                    horizontal={false}
                    alwaysBounceHorizontal={false}
                    alwaysBounceVertical={false}
                    refreshing={this.state.refreshing}
                    onRefresh={() => this.onRefresh()}
                >

                </ChainScrollView>
      </View>
    );
  }
}

Package Sidebar

Install

npm i @chainplatform/pull-to-refresh

Weekly Downloads

5

Version

0.2.8

License

MIT

Unpacked Size

13.9 kB

Total Files

5

Last publish

Collaborators

  • chainplatform