react-masonry-component: handleImagesLoaded triggers multiple times
handleImagesLoaded triggers multiple times,
I am using:
onLayoutComplete={handleImagesLoaded}
with function inside the createClass
onLayoutComplete={this.handleImagesLoaded}
it triggers 2 times , otherwise its 4 or 5
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 15
@arpecop @indapublic I don’t think this is a bug in Masonry or React Masonry Component.
the
layoutcomplete
event fires every time Masonry completes a layout. Do you find your layout updates several times on screen? This can happen as images are downloaded.If you want to capture 1 event every X seconds etc, you could try using Lodash’s throttle or debounce functions.
http://masonry.desandro.com/events.html#layoutcomplete