infinite scroll
참고
Infinite-scroll use React hooks
- link link - 해결법이 좋아 보인다
- link
- IntersectionObserver - Browser support](https://github.com/w3c/IntersectionObserver/tree/master/polyfill#browser-support) Image Lazy Load 구현해 보기
const options = {threshold: 0}
const observer = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
observer.unobserve(entry.target)
entry.target.src = entry.target.dataset.src
}
})
}, options)
observer.observe(Array.from(document.getElementsByClassName('lazy')))