# react-native-ridge-list

> FlatList abstraction which uses react-window on the web to create better list performance

Latest version **0.3.0** (published 2021-07-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-ridge-list
pnpm add react-native-ridge-list
yarn add react-native-ridge-list
bun add react-native-ridge-list
```

## 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.0 |
| Published | 2021-07-01 |
| First published | 2021-07-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 55.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Richard Lindhout |
| Maintainers | web-ridge |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-ridge-list
- Repository: https://github.com/web-ridge/react-native-ridge-list
- Homepage: https://github.com/web-ridge/react-native-ridge-list#readme
- Issues: https://github.com/web-ridge/react-native-ridge-list/issues
- npm.io page: https://npm.io/package/react-native-ridge-list

## Dependencies (2)

- [react-window](https://npm.io/package/react-window.md) ^1.8.6
- [react-window-infinite-loader](https://npm.io/package/react-window-infinite-loader.md) ^1.0.7

## 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.0 (latest) — 2021-07-01
- 0.2.0 — 2021-07-01

## README

# react-native-ridge-list
FlatList abstraction which uses [bvaughn/react-window](https://github.com/bvaughn/react-window) on the web to create better list performance

## Supported props
- ListHeaderComponent (you have to provide height in the ListHeaderComponentStyle, it understands height + marginTop, marginBottom etc.
- ListHeaderComponentStyle
- numColumns 
- maxToRenderPerBatch
- data
- renderItem
- getItemLayout
- onEndReached
- inverted
- testID


## Caveats
- you are required to provide the getItemLayout
- inverted FlatList always reverse scroll on Mac devices but don't understand other scroll behaviours in browsers other than Safari, because we can only detect this in Safari.
    - https://bugs.chromium.org/p/chromium/issues/detail?id=156551
    - https://github.com/w3c/uievents/issues/57
## Installation
```sh
yarn add react-native-ridge-list
```
or
```sh
npm install react-native-ridge-list
```


## Usage

```js
import RidgeList from "react-native-ridge-list";

const ITEM_HEIGHT = 65

function getDefaultItemLayout(
  data,
  index,
) {
  return {
    length: ITEM_HEIGHT,
    offset: ITEM_HEIGHT * index,
    index,
  };
}

// ...

<RidgeList
        data={DATA}
        renderItem={renderItem}
        keyExtractor={item => item.id}
        getItemLayout={getDefaultItemLayout}
      />
```

## Contributing

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

## License

MIT

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