2 |
3 |

4 |
5 | ### If this project has helped you out, please support us with a star 🌟
6 |
7 |
8 |
9 | [](http://npmjs.org/package/react-native-big-list)
10 | [](https://prettier.io/)
11 | [](http://npmjs.org/package/react-native-big-list)
12 |
13 |
14 |
15 | [Documentation](https://marcocesarato.github.io/react-native-big-list-docs/)
16 |
17 |
18 |
19 | ## 📘 Description
20 |
21 | #### What is this?
22 |
23 | This is a high performance list view for React Native with support for complex layouts using a similar FlatList usage to make easy the replacement.
24 | This list implementation for big list rendering on React Native works with a recycler focused on performance and memory usage and so it permits processing thousands items on the list.
25 |
26 | You can also try it on the published web app: [Demo](https://marcocesarato.github.io/react-native-big-list/)
27 |
28 | #### Why another list library?
29 |
30 | React Native's FlatList is great but when it comes to big lists it has some flaws because of its item caching.
31 | Exists some alternatives like `react-native-largelist` and `recyclerlistview` but both have some issues.
32 |
33 | The `react-native-largelist` isn't compatible with web and Expo, has native code that sometimes need to be readjusted and maintained, have a weird list item recycles (because it never has blank items), need data restructure and have some issues when trying to process a lot of data (eg: 100,000 items) because it would freeze the CPU.
34 |
35 | The `recyclerlistview` is performant but suffers from an empty frame on mount, weird scroll positions when trying to scroll to an element on mount, and the implementation of sticky headers conflicts with `Animated`.
36 |
37 | #### How it works?
38 |
39 | Recycler makes it easy to efficiently display large sets of data. You supply the data and define how each item looks, and the recycler library dynamically creates the elements when they're needed.
40 | As the name implies, the recycler recycles those individual elements. When an item scrolls off the screen, the recycler doesn't destroy its view. Instead, the recycler reuses the view for new items that have scrolled onscreen. This reuse vastly improves performance, improving your app's responsiveness and reducing power consumption.
41 |
42 | When list can't render your items fast enough the non-rendered components will appear as blank space.
43 |
44 | This library is fully JS native, so it's compatible with all available platforms: _Android, iOS, Windows, MacOS, Web and Expo_.
45 |
46 | ## 📖 Install
47 |
48 | Install the library from npm or yarn just running one of the following command lines:
49 |
50 | | npm | yarn |
51 | | ------------------------------------------ | -------------------------------- |
52 | | `npm install react-native-big-list --save` | `yarn add react-native-big-list` |
53 |
54 | ## 💻 Usage
55 |
56 | > Read also [How to migrate from FlatList](https://marcocesarato.github.io/react-native-big-list-docs/extras/migrate-flatlist/)
57 |
58 | Basic example:
59 |
60 | ```javascript
61 | import BigList from "react-native-big-list";
62 | // ...
63 | const MyExample = ({ data }) => {
64 | const renderItem = ({ item, index }) =>