An open API service indexing awesome lists of open source software.

https://github.com/frzkn/use-images-loaded

🖼️ Returns true once all the images inside a container are loaded
https://github.com/frzkn/use-images-loaded

custom hooks images load onload react

Last synced: about 1 year ago
JSON representation

🖼️ Returns true once all the images inside a container are loaded

Awesome Lists containing this project

README

          

## 🖼️ useImagesLoaded

Custom react hook which returns true once all the images inside a container are loaded.

Check out a working demo [here](https://use-images-loaded.netlify.app)

### 🚀 Getting Started

#### Installation

```
yarn add use-images-loaded
```

#### Usage

Displaying a loading indicator while images are loading in a container

```
import useImageLoaded from 'use-images-loaded'

const ImageContainer = () => {
const [ref, loaded] = useImagesLoaded()

return (


Status: {loaded ? 'Loaded': 'Loading'}


image
image
image

)
}
```