A simple react-library to lazy-load or prefetch images
Add to your package like this:
npm install --save react-image-lazy-prefetch
Or using Yarn:
yarn add react-image-lazy-prefetch
import Image from 'react-image-lazy-prefetch';
const MyComp = () => {
const imgSrc=`https://picsum.photos/200/300`
return <Image src={imgSrc} />
}
You can add the below optional params:
style
- the styles that you want on the resultant image (img
) tagwidth
- the width of the resultant imageheight
- the height of the resultant image
Only, one: react
(latest if possible).
MIT.
Here I am: https://knc.js.org
Twitter: @itsKNC