eiriklv / react-masonry-component

A React.js component for using @desandro's Masonry
MIT License
1.43k stars 145 forks source link

onImagesLoaded is being called twice #152

Closed MariuzM closed 4 years ago

MariuzM commented 4 years ago

onImagesLoaded is being called twice, one time in mid of rendering and second when its finished. Any tips on how to work around this so that i only have event when it's finished?

Quick demo of the issue, you will noticed console.log is being used twice. Untitled

MariuzM commented 4 years ago

This is how I've solved this:

    if (e.progressedCount !== 0) {
      document.querySelector('.portfolio-main').style.opacity = 1
    }