0.1.11 • Published 4 years ago

@nattlivet/react-pully v0.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react-pully

React pull-to-refresh with promises.

Installation

$ yarn add @nattlivet/react-pully
# or
$ npm add @nattlivet/react-pully

Usage

import Pully from '@nattlivet/react-pully';

import '@nattlivet/react-pully/dist/Pully.css'

const MyComponent = () => {
    return (
        <div className="MyComponent">
            <Pully onRefresh={() => new Promise(async (resolve) => {
                await someSlowTask();
                return resolve();
            })}>
            </Pully>
        </div>
    ):
}

export default MyComponent;

Component styles

To prevent Chrome overscroll set overscroll-behavior-y: contain [or] none; on <body> (learn more).

Props

PropRequiredTypeDefaultDescription
onRefreshtrueFunctionundefinedCalled when a pull is triggered
classNamefalseStringPullyClass applied to the component
distThresholdfalseNumber72Distance where refresh is triggered
resistancefalseNumber2.5How hard it is to pull down
disabledfalseBooleanfalseDisables all functionality

Credits

Inspired by react-pullable ❤️

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago