@bang88/react-native-ultimate-listview

中文文档
4.1.1发布于 2024/08/08MITCommonJS零依赖近 30 天下载 4.3万

A high performance FlatList providing customised pull-to-refresh | auto-pagination & infinite-scrolling | gridview layout | swipeable-row. The truly ultimate version that I have done the most tricky part for you, just simply follow the instructions shown

原始使用文档

React Native Ultimate Listview

This Library includes two components: UltimateListView and UltimateRefreshView

  • UltimateListView: A high performance FlatList providing customised pull-to-refresh | auto-pagination & infinite-scrolling | gridview layout | swipeable-row. The truly ultimate version that I have done the most tricky part for you, you can treat this module as an enhanced FlatList with all excellently extra features, comparing to the official version.
  • UltimateRefreshView: A refreshable ScrollView providing customised pull-to-refresh feature, which has already been using in the UltimateListView, but it can be used independently.

This module supports both of iOS and Android platforms.

All codes are written in ES6 syntax, and meet most rules of Eslint syntax

Quick installation

  • If on react-native < 0.43: yarn add [email protected]
  • If on react-native >= 0.43 yarn add react-native-ultimate-listview@latest

Know Issue (v3.3.0): On Android, if you are using CustomRefreshView, and the total hight of your first load data is less than your device height, then the RefreshView may still sticky on the top. However, if the data you loaded is beyond your screen, everything's fine. This issue only happen on Android, any PR is welcome.

Demo

iOSAndroid
FlatList

Usage

import { UltimateListView, UltimateRefreshView } from 'react-native-ultimate-listview'
    <UltimateRefreshView onRefresh={this.onRefresh}>
         <YourView/>
    </UltimateRefreshView>

    <UltimateListView
       ref={ref => this.listView = ref}
       key={this.state.layout}
       onFetch={this.onFetch}
       keyExtractor={(item, index) => `${index} - ${item}`} 
       refreshableMode="advanced" // basic or advanced
       item={this.renderItem} // this takes three params (item, index, separator)       
       displayDate
       arrowImageStyle={{ width: 20, height: 20, resizeMode: 'contain' }}/>

Or you can look through this link: Usage

Documentation

Breaking Changes

  • Provide a new Component , which extends

  • Change import syntax to:

    import { UltimateListView, UltimateRefreshView } from 'react-native-ultimate-listview'

Contribution

@gameboyVito - [email protected]

  1. Fork this Repository, then run yarn or npm install in the root folder
  2. After modifying the code, in the root folder, run yarn eslint-fix or npm run eslint-fix
  3. Make sure your code satisfy the eslint rules, then commit and push your code
  4. Open your Github, create a pull request to me. I will review it ASAP, thanks a lot.

Why FlatList

I have found some articles to explain why you need to use FlatList instead of the legacy ListView. There are some obvious reasons:

  1. FlatList is just like the UICollectionView or RecyclerView, which can dramatically reduce memory usage. It also provides smoother animation when you have an extremely long list.
  2. FlatList supports scrollToIndex function, which is pretty convenient when you want to scroll to an item with index, instead of depending the y-offset.
  3. FlatList recommend developer to use PureComponent to reduce unnecessary re-rendering, this can really boost the performance and make your app run faster.

License

MIT

版本与发布记录

@bang88/react-native-ultimate-listview 共发布 8 个版本,首次发布于 2018/12/15;过去 12 个月发布了 0 个版本。

版本发布日期距今
4.1.1latest2024/08/082 年前
4.1.02022/03/144 年前
4.0.02021/05/285 年前
3.3.42020/08/116 年前
3.3.32020/08/106 年前
3.3.22020/07/206 年前

关于 @bang88/react-native-ultimate-listview 的常见问题

@bang88/react-native-ultimate-listview 是什么?

A high performance FlatList providing customised pull-to-refresh | auto-pagination & infinite-scrolling | gridview layout | swipeable-row. The truly ultimate version that I have done the most tricky part for you, just simply follow the instructions shown

如何安装 @bang88/react-native-ultimate-listview?

在项目目录运行 npm install @bang88/react-native-ultimate-listview,或使用 pnpm add / yarn add / bun add。

@bang88/react-native-ultimate-listview 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bang88__react-native-ultimate-listview 是否存在。

@bang88/react-native-ultimate-listview 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@bang88/react-native-ultimate-listview 可以商用吗?

@bang88/react-native-ultimate-listview 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bang88/react-native-ultimate-listview 的下载量有多少?

根据 npm 官方下载统计,@bang88/react-native-ultimate-listview 在 2026/10/08 – 2026/11/06 这 30 天内被下载 42,644 次,日均约 1,421 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bang88/react-native-ultimate-listview 还在维护吗?

最新版本 4.1.1 发布于 2024/08/08(2 年前);至今共发布 8 个版本,其中过去 12 个月发布了 0 个;首次发布于 2018/12/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。