@react-native-oh-tpl/react-native-mjrefresh
Version:
This project is based on [react-native-mjrefresh](https://github.com/react-native-studio/react-native-MJRefresh) ## Documentation [中文](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-MJRefresh.md)
21 lines (20 loc) • 805 B
JavaScript
import React, {Component} from 'react';
import {VirtualizedList, FlatList,Platform} from 'react-native';
class MJFlatList extends FlatList {
render() {
return (
<VirtualizedList
{...this.props}
renderItem={this._renderItem}
getItem={this._getItem}
getItemCount={this._getItemCount}
keyExtractor={this._keyExtractor}
ref={this._captureRef}
onViewableItemsChanged={
this.props.onViewableItemsChanged && this._onViewableItemsChanged
}
/>
);
}
}
module.exports = (Platform.OS === 'ios' || Platform.OS === 'harmony') ? MJFlatList : FlatList;