Skip to content

Commit d8de87f

Browse files
Add onEndReached prop for FlatList (#180, #182)
Co-authored-by: Arthur Arakelyan <[email protected]>
1 parent 930572d commit d8de87f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Prop | Type | Optional | Default | Description
175175
`enableLongPress` | bool | Yes | false | enables long press. When true, `onModalOpen` returns `{longPress: true}`
176176
`optionsTestIDPrefix` | string | Yes | `'default'` | This prefixes each selectable option's testID prop if no testID keys are provided in `props.data` array objects. Default for each option's testID: 'default-\<optionLabel\>'
177177
`header` | node | Yes | undefined | Render a header above the list
178+
`onEndReached` | function | Yes | undefined | Called once when the scroll position gets of the rendered content.
178179

179180
### Methods
180181

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const propTypes = {
7777
enableLongPress: PropTypes.bool,
7878
optionsTestIDPrefix: PropTypes.string,
7979
header: PropTypes.node,
80+
onEndReached: PropTypes.func,
8081
};
8182

8283
const defaultProps = {
@@ -132,6 +133,7 @@ const defaultProps = {
132133
enableLongPress: false,
133134
optionsTestIDPrefix: 'default',
134135
header: undefined,
136+
onEndReached: undefined,
135137
};
136138

137139
export default class ModalSelector extends React.Component {
@@ -322,6 +324,7 @@ export default class ModalSelector extends React.Component {
322324
accessibilityLabel={scrollViewAccessibilityLabel}
323325
keyExtractor={this.props.keyExtractor}
324326
renderItem={this.renderFlatlistOption}
327+
onEndReached={this.props.onEndReached}
325328
/>
326329
:
327330
<ScrollView

0 commit comments

Comments
 (0)