|
| 1 | +--- |
| 2 | +title: Props |
| 3 | +slug: /props |
| 4 | +--- |
| 5 | + |
| 6 | +This package is a wrapper around react-native's FlatList. So it accepts all the props from `FlatList`, except for [`maintainVisibleContentPosition`](https://reactnative.dev/docs/0.63/scrollview#maintainvisiblecontentposition). It has support for following additional props, to fine tune your infinite scroll. |
| 7 | + |
| 8 | + |
| 9 | +### `onEndReached` |
| 10 | + |
| 11 | +Called once when the scroll position gets close to end of list. This must return a promise. |
| 12 | +You can `onEndReachedThreshold` as distance from end of list, when this function should be called. |
| 13 | + |
| 14 | + |
| 15 | +| type | default | required | |
| 16 | +| -------- | ------- | -------- | |
| 17 | +| function | null | YES | |
| 18 | + |
| 19 | + |
| 20 | +### `onStartReached` |
| 21 | + |
| 22 | +Called once when the scroll position gets close to begining of list. This must return a promise. |
| 23 | +You can `onStartReachedThreshold` as distance from beginning of list, when this function should be called. |
| 24 | + |
| 25 | +| type | default | required | |
| 26 | +| -------- | ------- | -------- | |
| 27 | +| function | null | YES | |
| 28 | + |
| 29 | +### `activityIndicatorColor` |
| 30 | + |
| 31 | +Color for inline loading indicator |
| 32 | + |
| 33 | +| type | default | required | |
| 34 | +| ------ | ------- | -------- | |
| 35 | +| string | #000000 | NO | |
| 36 | + |
| 37 | +### `enableAutoscrollToTop` |
| 38 | + |
| 39 | +Enable autoScrollToTop. |
| 40 | +In chat type applications, you want to auto scroll to bottom, when new message comes it. |
| 41 | + |
| 42 | +| type | default | required | |
| 43 | +| ------ | ------- | -------- | |
| 44 | +| string | false | NO | |
| 45 | + |
| 46 | +### `autoscrollToTopThreshold` |
| 47 | + |
| 48 | +The scroll offset threshold, below which auto scrolling should occur. |
| 49 | + |
| 50 | +:::info |
| 51 | + |
| 52 | +This prop only works, when `enableAutoscrollToTop` is set to true. |
| 53 | + |
| 54 | +::: |
| 55 | + |
| 56 | +| type | default | required | |
| 57 | +| -------- | ------- | -------- | |
| 58 | +| number | 100 | NO | |
| 59 | + |
| 60 | + |
| 61 | +### `onStartReachedThreshold` |
| 62 | + |
| 63 | +Scroll offset from beginning of list, when onStartReached should be called. |
| 64 | + |
| 65 | +| type | default | required | |
| 66 | +| -------- | ------- | -------- | |
| 67 | +| number | 10 | NO | |
| 68 | + |
| 69 | +### `onEndReachedThreshold` |
| 70 | + |
| 71 | +Scroll distance from end of list, when onStartReached should be called. |
| 72 | +Please note that this is different from onEndReachedThreshold of FlatList from react-native. |
| 73 | + |
| 74 | +| type | default | required | |
| 75 | +| -------- | ------- | -------- | |
| 76 | +| number | 10 | NO | |
| 77 | + |
| 78 | +### `showDefaultLoadingIndicators` |
| 79 | + |
| 80 | +If true, inline loading indicators will be shown |
| 81 | + |
| 82 | +| type | default | required | |
| 83 | +| -------- | ------- | -------- | |
| 84 | +| boolean | true | NO | |
| 85 | + |
| 86 | +### `HeaderLoadingIndicator` |
| 87 | + |
| 88 | +Custom UI component for header inline loading indicator |
| 89 | + |
| 90 | +| type | default | required | |
| 91 | +| -------- | ------- | -------- | |
| 92 | +| Component | [ActivityIndicator](https://reactnative.dev/docs/0.63/activityindicator) | NO | |
| 93 | + |
| 94 | + |
| 95 | +### `FooterLoadingIndicator` |
| 96 | + |
| 97 | +Custom UI component for footer inline loading indicator |
| 98 | + |
| 99 | +| type | default | required | |
| 100 | +| -------- | ------- | -------- | |
| 101 | +| Component | [ActivityIndicator](https://reactnative.dev/docs/0.63/activityindicator) | NO | |
| 102 | + |
| 103 | + |
| 104 | +### `ListHeaderComponent` |
| 105 | + |
| 106 | +Custom UI component for header indicator of FlatList, which overrides the HeaderLoadingIndicator. Only used when `showDefaultLoadingIndicators` is false |
| 107 | + |
| 108 | +| type | default | required | |
| 109 | +| -------- | ------- | -------- | |
| 110 | +| Component | null | NO | |
| 111 | + |
| 112 | + |
| 113 | +### `ListFooterComponent` |
| 114 | + |
| 115 | +Custom UI component for footer indicator of FlatList, which overrides the FooterLoadingIndicator. Only used when `showDefaultLoadingIndicators` is false |
| 116 | + |
| 117 | +| type | default | required | |
| 118 | +| -------- | ------- | -------- | |
| 119 | +| Component | null | NO | |
| 120 | + |
| 121 | + |
0 commit comments