1.0.3 • Published 4 years ago

@emergy/components-lazy-loading v1.0.3

Weekly downloads
3
License
MIT
Repository
-
Last release
4 years ago

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

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago