1.1.10 โ€ข Published 4 years ago

onimagesdidload-ts v1.1.10

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

Table of Contents

Why this Component

Unfortunately React lifecycle methods aren't enough for doing your logic after images are loaded . For example If you wanna get always the right height of images container or make an images loading spinner ... ๐Ÿค” that component will be useful for you ๐ŸŽ‰

Built With

  • React
  • TypeScript (TypeScript JSX)

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

React.js/TypeScript project Help ?

Installation

1.Install it using NPM

npm i onimagesdidload-ts

2.Then import it in your tsx component:

import OnImagesDidLoad from "onimagesdidload-ts";

Usage

 <OnImagesDidLoad
    onLoaded={callback} /* start your logic when images are loaded */
    doesImagesUpdated={boolean} /* boolean to inform onImagesDidLoad component that there is new images */
    classNameWhileLoading={" ... "}/* CSS Classes while loading */
    classNameOnloaded={" ... "}/* CSS Classes when images are loaded */ >
    
    /* your logic to display images , cards ... */
    <div className="myCoolImages">
       
    </div>
    
  </OnImagesDidLoad>
    

Props

  • onLoaded [Required] : callback function to start your logic when images are loaded,
  • doesImagesUpdated [Required] : boolean to inform OnImagesDidLoad component that there is new images ( so OnImagesDidLoad will restart his process)
  • classNameWhileLoading [optional] : prefix css classes added to the container element while images are loading default .spinning,
  • classNameOnloaded [optional] :prefix css classes added to the container element when images are loading default .imagesLoaded,

Spinner while images gets loaded Demo

Contact

Taha seddik - taha.seddik1992@gmail.com

Project Link: https://github.com/NoobDay/onimagesdidload-ts

1.1.9

4 years ago

1.1.10

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago