react-intersection-observer-hook
react-intersection-observer-hook copied to clipboard
Create-React-App testing fails
Hi there,
I have a react component that uses your react-infinite-scroll-hook and couldn't get tests for it to work properly. I would always get the following error:
ReferenceError: IntersectionObserver is not defined
Here is a minimal reproduction example. I also used intersetion-observer polyfill as a workaround for this issue and it seems to work fine. Just toggle the first import statement in App.js.
By the way, when I tried testing that component with plain @testing-library/react, it worked just fine.