# react-js-pull-to-refresh

> React pull to refresh

Latest version **1.3.0** (published 2022-08-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-js-pull-to-refresh
pnpm add react-js-pull-to-refresh
yarn add react-js-pull-to-refresh
bun add react-js-pull-to-refresh
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2022-08-22 |
| First published | 2017-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 726.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 34 |
| Author | echoulen |
| Maintainers | echoulen |
| Keywords | react, pull-to-refesh |

## Links

- npm: https://www.npmjs.com/package/react-js-pull-to-refresh
- Repository: https://github.com/echoulen/react-js-pull-to-refesh
- Homepage: https://github.com/echoulen/react-js-pull-to-refesh#readme
- Issues: https://github.com/echoulen/react-js-pull-to-refesh/issues
- npm.io page: https://npm.io/package/react-js-pull-to-refresh

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2022-08-22
- 1.2.3 — 2021-08-08
- 1.2.2 — 2019-04-16
- 1.2.1 — 2018-11-19
- 1.2.0 — 2018-10-28
- 1.1.0 — 2018-10-13
- 1.0.10 — 2018-10-12
- 1.0.9 — 2018-10-12
- 1.0.8 — 2018-01-03
- 1.0.7 — 2018-01-02
- 1.0.6 — 2017-12-22
- 1.0.5 — 2017-12-22
- 1.0.4 — 2017-12-22
- 1.0.3 — 2017-12-21
- 1.0.2 — 2017-12-21
- … 14 more at https://npm.io/package/react-js-pull-to-refresh/versions

## 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)


[![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)
[![codebeat badge](https://codebeat.co/badges/3be54568-d7c5-4cc2-b5a4-8eae143b4dbf)](https://codebeat.co/projects/github-com-echoulen-react-pull-to-refresh-master)
[![size](https://badgen.net/bundlephobia/minzip/react-js-pull-to-refresh)](https://bundlephobia.com/result?p=react-js-pull-to-refresh@1.2.1)

![](https://media.giphy.com/media/xT1R9LCrbpOJ4J7HoI/giphy.gif)

## Demo
[See the demo in action at https://echoulen.github.io/react-pull-to-refresh/](https://echoulen.github.io/react-pull-to-refresh/)

## Installation
```bash
npm install react-js-pull-to-refresh --save
```

or

```bash
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 or 'auto'|false|
|backgroundColor|string|false|
|startInvisible|boolean|false|

## Usage

### Import PullToRefresh
```js
import {PullToRefresh} from "react-js-pull-to-refresh";
```

### Import default content (optional)
```typescript
import {PullDownContent, ReleaseContent, RefreshContent} from "react-js-pull-to-refresh";
```


### Sample
```jsx
<PullToRefresh
  pullDownContent={<PullDownContent />}
  releaseContent={<ReleaseContent />}
  refreshContent={<RefreshContent />}
  pullDownThreshold={200}
  onRefresh={this.onRefresh}
  triggerHeight={50}
  backgroundColor='white'
  startInvisible={true}
>
  <div style={{height: '150vh', textAlign: 'center'}}>
    <div>PullToRefresh</div>
  </div>
</PullToRefresh>
```

### Sample code in typescript
[Link](https://github.com/echoulen/react-pull-to-refresh/blob/master/examples/Basic.tsx)

## Contributing
```bash
npm run dev
```

---
_Source: https://npm.io/package/react-js-pull-to-refresh · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
