Commit 2bf09d41 authored by AFOC-1709091830\echou's avatar AFOC-1709091830\echou

modify readme

parent 1a8635b4
# react-js-pull-to-refresh
Pull to refresh on web
Pull to refresh with react
> Support all mobile(iOS, Android) and Desktop browser (Chrome, Safari, firefox, Opera, QQ, UC, ... etc)
[![npm version](https://badge.fury.io/js/react-js-pull-to-refresh.svg)](https://badge.fury.io/js/react-js-pull-to-refresh)
[![license](https://img.shields.io/github/license/echoulen/react-js-pull-to-refresh.svg)](https://opensource.org/licenses/MIT)
......@@ -14,11 +17,35 @@ or
`yarn add react-js-pull-to-refresh`
## Props
- pullDownContent: JSX.Element (Required)
- releaseContent: JSX.Element (Required)
- refreshContent: JSX.Element (Required)
- pullDownThreshold: number (Required)
- onRefresh: () => Promise<any> (Required)
|Name|Type|Required
|:------:|:------:|:------:|
|pullDownContent|JSX.Element|true|
|releaseContent|JSX.Element|true|
|refreshContent|JSX.Element|true|
|pullDownThreshold|number|true|
|onRefresh|Promise|true|
## Usage
See examples folder
#### import PullToRefresh
```js
import {PullToRefresh} from "react-js-pull-to-refresh";
```
#### Sample
```js
<PullToRefresh
pullDownContent={<div style={{backgroundColor: "grey", height: "200px", textAlign: "center"}}>Pull down to refresh</div>}
releaseContent={<div style={{backgroundColor: "green", height: "200px", textAlign: "center"}}>Release to refresh</div>}
refreshContent={<div style={{backgroundColor: "yellow", height: "200px", textAlign: "center"}}>Refreshing</div>}
pullDownThreshold={200}
onRefresh={this.onRefresh}
>
<div style={{height: "150vh", textAlign: "center"}}>
<div>PullToRefresh</div>
</div>
</PullToRefresh>
```
## Contributing
`npm run dev`
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment