react-native-gifted-chat icon indicating copy to clipboard operation
react-native-gifted-chat copied to clipboard

can u help me know why onLoadEarlier not get called?

Open fukemy opened this issue 3 years ago • 4 comments

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 avatar May 01 '22 04:05 fukemy

@fukemy Hey, Have you got any solution for this?

Prasannsitani avatar Aug 15 '22 20:08 Prasannsitani

you need add the property infiniteScroll={true}

matiasj899 avatar Jan 30 '23 18:01 matiasj899

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}

anniewey avatar Oct 04 '23 07:10 anniewey