eiriklv/react-masonry-component

onImagesLoaded is being called twice

Closed this issue · 1 comments

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

This is how I've solved this:

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