Yash Patel
Yash Patel

Reputation: 21

How to use lazy loading in react-image-gallery?

I am using react-image-gallery and the requirement is to implement a gallery that will load 100 images at a time. So how can I achieve this?

Upvotes: 0

Views: 1814

Answers (2)

Hameez Rizwan
Hameez Rizwan

Reputation: 326

React-image-gallery provides a prop with the name of lazyLoad which accepts a Boolean value. Set it to true to achieve the lazyloading.

It would go like this

<ImageGallery 
    lazyload={true}
    items={images}
/>

Upvotes: 3

Henya14
Henya14

Reputation: 86

If you look at the documentation (https://github.com/xiaolin/react-image-gallery) there is a lazyLoad prop on the component.

Upvotes: 1

Related Questions