@emergy/components-lazy-loading
v1.0.3
Published
## Introduction
Downloads
5
Readme
components-lazy-loading
Introduction
Easily lazy-load a picture and load them using webp
Install
yarn add components-lazy-loading
Usage
import * as React from "react";
import { Img } from "@emergy/components-lazy-loading";
const AboutPage = () => {
const imgLazyLoad = {
original: require("./../assets/img/lazy-loading.jpg"),
resized: require("./../assets/img/lazy-loading.jpg?resize&sizes[]=128&sizes[]=300&sizes[]=600&sizes[]=1024&sizes[]=1920"),
webp: require("./../assets/img/lazy-loading.webp")
};
return (
<div>
<Img lazy={imgLazyLoad} alt="Lazy Loading images" width="1000" />
</div>
);
};
export default AboutPage;
Test
Basic test are created and executed for each build.
The test with enzyme doesn't work properly yet.
License
MIT © mlescaudron