Get Lazy Lazy Loading Images Lazily
This project was bootstrapped with Create React App and showcases a demo to easily utilize the IntersectionObserver
API to lazy load images without doing work on the main thread.
To get started, simply run yarn start
and check out the demo in your browser (http://localhost:3000)!
IntersectionObserver
in React.src
attribute to reference the placeholder image when the page first loads and using the data-src
attributes which reference the URL of the image to load when the element is in the viewport.IntersectionObserver