intersectionObserver to detect elements in the viewport and lazy load them.
- Supported by all major browsers
- Low performance compared to browser native
Browser Native lazy loading
The threshold of lazy loading is determined by the browser-based on several factors like connection speed, data saver mode, etc.
- Fast, high performance
- Less chance of conflicts
- Browser intelligently calculates the threshold
- Not supported in all browsers, like Safari
You can read more about native lazy loading here: https://web.dev/native-lazy-loading/