Created
March 5, 2020 13:33
-
-
Save sueLan/aa6ac8954143490e719790f0313bb8eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viewabilityConfig = { | |
waitForInteraction: true, | |
viewAreaCoveragePercentThreshold: 95, | |
itemVisiblePercentThreshold: 75 | |
} | |
onViewableItemsChanged = ({viewableItems, changed}) => { | |
console.log("Visible items are", viewableItems); | |
console.log("Changed in this iteration", changed); | |
}; | |
render() { | |
return ( | |
<FlatList | |
style={{ | |
paddingTop: 60 | |
}} | |
viewabilityConfig={this.viewabilityConfig} | |
onViewableItemsChanged={this.onViewableItemsChanged} | |
data={this._items} | |
renderItem={this._renderItem} | |
keyExtractor={item => item.id} | |
/> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment