Helps you write better React Native lists. `getItemLayout` is implemented out of the box, with default `ListEmptyComponent` and `ItemSeparatorComponent`.
npm install rn-extended-flatlistHelps you write better React Native lists. getItemLayout is implemented out of the box, with default ListEmptyComponent and ItemSeparatorComponent.
``tsx
import React from 'react';
import {Text} from 'react-native';
import {ExtendedFlatList} from 'rn-extended-flatlist';
const MyList = () => (
listItemHeight={100}
emptyListMessage="Whoops! Nothing to show"
keyExtractor={(item) => String(item)}
renderItem={({item}) =>
/>
);
export default MyList;
`
| Props | Type | Description | Default Value |
|--------------------|---------|---------------------------------------------------------------------|---------------|
| emptyListMessage | string | Message to show when no items available\. | "Empty List" |
| listItemHeight | number | When provided, \getItemLayout will be automatically implemented\. | undefined |ItemSeparatorComponent
| noItemSeparator | boolean | Hides \ | false |ListEmptyComponent
| noEmptyListMessage | boolean | Hides \ | false |
| Props | Type | Description | Default Value |
|--------------------|-----------|-------------------------------------------|---------------|
| message | string | Message to show when no items available\. | "Empty List" |
| textStyle | TextStyle | Custom style for the message\. | undefined |
| containerStyle | ViewStyle | Custom style for the container\. | undefined |
$3
A partial function that accepts the
listItemHeight and returns the function expected by React Native FlatList's getItemLayout prop.
$3
- [ ] Add example snack.
- [ ]
onEndReached should be debounced.
- [ ] Support dynamic item height.$3
rn-extended-flatlist` is MIT licensed, as found in the LICENSE file.