I want to track it so that when they reached bottom of the screen, i will call a function to fetch more data.
I have an app.js where inside is Products / component wherein it fetches data.
Products / is wrapped by a div.gallery container
I already used Intersection Observer but still fails, but maybe i used it wrong.
3
Answers
Credit: Educative.io
You can use
react-intersection-observer
and you can implement it like this.You can use IntersectionObserver like this, Whenever the end element is visible it’ll trigger a callback. You can perform any action you want inside the callback.