Is there a way to fetch data when a specific div comes into view on a SSR page in Next.js? I attempted using the onScroll event on the div, but it doesn't seem to be triggering. Any suggestions?
function handleScroll() {
console.log("scrolled to element")
}
<section onScroll={handleScroll} className={`${styles.notifTop} marginTop2 container`}>
<p className={styles.notifTitle}>Taking actions over words!</p>
<p className={`${styles.notifParagraph}`}>The accumulation of <span className="fontWeight400">small individual actions</span> will help accomplish the <span className="fontWeight400">large collective challenges</span> that we can no longer ignore.</p>
</section>