react-infinite-scroller
react-infinite-scroller copied to clipboard
Not calling loadMore with @testing-library/react
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
I have the same issue. Can someone help me on this question also? Thank you so much.
i moved to this lib https://github.com/ankeetmaini/react-infinite-scroll-component works fine