react-hooks-infinite-scroll icon indicating copy to clipboard operation
react-hooks-infinite-scroll copied to clipboard

Jest Tests complain about async tasks cleanup not present

Open michaelryancaputo opened this issue 6 years ago • 0 comments

Hi! I found your article on upmostly. I found it very useful, however I'm trying to write a Jest test for this module using the react-testing-library. It seems like there is something that is not being cancelled. The error is this:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.

I think it's complaining about the fetchMoreListItems function not being cancelable.

Any thoughts on this?

michaelryancaputo avatar Feb 19 '19 18:02 michaelryancaputo