react-lazy-img

React <img> drop-in replacement for lazy image loading


Keywords
react, img, image, lazy, loader, loading, performance, defer, intersection, observer, intersectionobserver
License
MIT
Install
npm install react-lazy-img@1.0.2

Documentation

React Lazy Image

Usage

import LazyImg from 'react-lazy-img'

// ...

<LazyImg src='path/to/img.jpg' onImageLoad={() => console.log('image loaded!')} />

The CSS class -loaded is automatically added when image is ready.

License

MIT © Fernando Daciuk