Hasham Minhas
Hasham Minhas

Reputation: 508

What next function is not getting called for react infinite scroll

I'm trying to use react infinite scroll to call more data on scroll but not able to integrate this library properly the next event is not getting triggered when if I scroll to whole page

  <InfiniteScroll
    dataLength={10}
    next={fetchData}
    hasMore
    loader={<Spinner />}
  >
    <>
      {ideas.results?.map((idea, index) => <IdeaCard key={index} idea={idea} getAllIdeas={getAllIdeas} />)}
    </>
  </InfiniteScroll>

Upvotes: 2

Views: 371

Answers (0)

Related Questions