# react-native-djrefresh-library

> pull to refresh with flatlist

Latest version **0.3.1** (published 2024-06-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-djrefresh-library
pnpm add react-native-djrefresh-library
yarn add react-native-djrefresh-library
bun add react-native-djrefresh-library
```

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2024-06-06 |
| First published | 2023-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 168.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Hay Huang |
| Maintainers | huiqun922 |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-djrefresh-library
- Repository: https://github.com/huiqun922/djrefresh
- Homepage: https://github.com/huiqun922/djrefresh.git#readme
- Issues: https://github.com/huiqun922/djrefresh.git/issues
- npm.io page: https://npm.io/package/react-native-djrefresh-library

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.3.1 (latest) — 2024-06-06
- 0.3.0 — 2024-06-05
- 0.2.3 — 2024-05-30
- 0.2.2 — 2024-04-02
- 0.2.1 — 2023-11-22
- 0.2.0 — 2023-11-20
- 0.1.9 — 2023-11-17
- 0.1.8 — 2023-11-17
- 0.1.7 — 2023-11-17
- 0.1.6 — 2023-09-06
- 0.1.5 — 2023-08-31
- 0.1.4 — 2023-08-31
- 0.1.3 — 2023-08-25
- 0.1.1 — 2023-08-25

## README

# react-native-djrefresh-library

pull to refresh with flatlist
iOS with MJRefresh
Android Native fork SwipeRefreshLayout

![](example/screenshot_android.gif)


 
## Installation

```sh
npm install react-native-djrefresh-library
```

## Usage
### ios
```sh
cd ios & pod install
```
```js
import {
  DJRefreshDefaultHeader,
  DJRefreshHeader,
} from 'react-native-djrefresh-library';

// ...

  <FlatList
          contentInsetAdjustmentBehavior="never"
          automaticallyAdjustContentInsets={false}
          style={styles.list}
          data={DATA}
          renderItem={({ item }) => <Item title={item.title} />}
          keyExtractor={(item) => item.id}
          refreshControl={
            // default header
            // <DJRefreshDefaultHeader
            //   refreshing={refreshing}
            //   onRefresh={() => {
            //     console.log('开始刷新');
            //     setRefreshing(true);
            //     setTimeout(() => {
            //       console.log('结束刷新');
            //       setRefreshing(false);
            //     }, 3000);
            //   }}
            // />

            //custom header
            <DJRefreshHeader
              refreshHeader={
                <View style={{ height: 55 }}>
                  <LottieView
                    style={{ width: '100%', height: 55 }}
                    source={require('./assets/animation_llq8e2yb.json')}
                    autoPlay
                    loop
                  />
                </View>
              }
              refreshing={refreshing}
              onRefresh={() => {
                console.log('开始刷新');
                setRefreshing(true);
                setTimeout(() => {
                  console.log('结束刷新');
                  setRefreshing(false);
                }, 3000);
              }}
            />
          }
        />
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)

---
_Source: https://npm.io/package/react-native-djrefresh-library · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
