react-native-gifted-chat
react-native-gifted-chat copied to clipboard
can u help me know why onLoadEarlier not get called?
hi, i want to implement scroll down to get more message, here is my code:
const handleLoadMore = () => {
console.log('handleLoadMore')
setMessage(prev => GiftedChat.prepend(prev, loadMoreSample))
}
const renderLoadEarlier = (props) => {
return <ActivityIndicator {...props} style={{margin: 10}}/>
}
//GiftedChat config
onLoadEarlier={handleLoadMore}
loadEarlier={true}
isLoadingEarlier={true}
renderLoadEarlier={renderLoadEarlier}
but when scroll down i can see the ActivityIndicator, but handleLoadMore not get called
@fukemy Hey, Have you got any solution for this?
you need add the property infiniteScroll={true}
Had the same issue, notice that isLoadingEarlier need to set to false
infiniteScroll={true}
loadEarlier={true}
isLoadingEarlier={isFetchingMore} //false by default, set to true in onFetchMore()
onLoadEarlier={onFetchMore}