State in IntersectionObserver callback is undefined
I have a react app that displays a grid of 3 columns. I’m trying to implement the Intersection Observer Api to enable infinite scroll, however, it’s not working. The following code prints out:
IntersectionObserver callback is being run even if the target isnt on the viewport
I am trying to execute a function when an element is visible in the viewport but the callback is running even if the element is wayyy below.