react-infinite-scroller icon indicating copy to clipboard operation
react-infinite-scroller copied to clipboard

Not calling loadMore with @testing-library/react

Open ButuzGOL opened this issue 4 years ago • 2 comments

In browser all works fine

<div
        style={{
          marginLeft: -24,
          marginRight: -24,
          overflow: 'auto',
          height: 'calc(100% - 122px)',
        }}
        ref={scrollParentRef}
      >
        <InfiniteScroll
          pageStart={0}
          loadMore={fetchData}
          hasMore={hasMoreData.current}
          useWindow={false}
          getScrollParent={() => scrollParentRef.current}
          loader={
            <Card>
              <Skeleton active />
            </Card>
          }
        >
          {data.map((item) => (
            <Comment
              key={item.id}
              content={<p>{item.comment}</p>}
            />
          ))}
        </InfiniteScroll>

But when start testing it not calls fetchData (loadMore) fn

ButuzGOL avatar Jan 08 '21 17:01 ButuzGOL

I have the same issue. Can someone help me on this question also? Thank you so much.

engp8691 avatar Jun 20 '21 18:06 engp8691

i moved to this lib https://github.com/ankeetmaini/react-infinite-scroll-component works fine

ButuzGOL avatar Jun 22 '21 09:06 ButuzGOL