@ephys/react-js-pull-to-refresh
v1.3.1
Published
React pull to refresh
Downloads
5
Readme
react-js-pull-to-refresh
Pull to refresh with react
Support all mobile(iOS, Android) and Desktop browser (Chrome, Safari, firefox, Opera, QQ, UC, ... etc)
Demo
See the demo in action at https://echoulen.github.io/react-pull-to-refresh/
installation
npm install react-js-pull-to-refresh --save
or
yarn add react-js-pull-to-refresh
Props
|Name|Type|Required |:------:|:------:|:------:| |pullDownContent|JSX.Element|true| |releaseContent|JSX.Element|true| |refreshContent|JSX.Element|true| |pullDownThreshold|number|true| |onRefresh|Promise|true| |triggerHeight|number|false| |backgroundColor|string|false|
Usage
import PullToRefresh
import {PullToRefresh} from "react-js-pull-to-refresh";
import default content (optional)
import {PullDownContent, ReleaseContent, RefreshContent} from "react-js-pull-to-refresh";
Sample
<PullToRefresh
pullDownContent={<PullDownContent />}
releaseContent={<ReleaseContent />}
refreshContent={<RefreshContent />}
pullDownThreshold={200}
onRefresh={this.onRefresh}
triggerHeight={50}
backgroundColor='white'
>
<div style={{height: '150vh', textAlign: 'center'}}>
<div>PullToRefresh</div>
</div>
</PullToRefresh>
Sample code in typescript
Contributing
npm run dev