I was hoping to create a HOC where I’d hook on Flickity events to set a loading state so that I could display a kind of mock or loading skeleton for the slider while flickity isn’t ready or when images have not loaded yet...
I’ve tried to use the lazyload event in order to check for images and then use useEffect(), useState() to define its loading state, but that seems too late for displaying a loading skeleton...
I also tried to apply a css class to the slides container when images were not yet loaded, but by using lazyload, the images are loaded so fast that the styles which mimic a loading skeleton are quickly removed after lazyload is done...
I’d really appreciate any hints regarding a proper way of achieving that effect...
I was hoping to create a HOC where I’d hook on Flickity events to set a loading state so that I could display a kind of mock or loading skeleton for the slider while flickity isn’t ready or when images have not loaded yet...
I’ve tried to use the lazyload event in order to check for images and then use useEffect(), useState() to define its loading state, but that seems too late for displaying a loading skeleton...
I also tried to apply a css class to the slides container when images were not yet loaded, but by using lazyload, the images are loaded so fast that the styles which mimic a loading skeleton are quickly removed after lazyload is done...
I’d really appreciate any hints regarding a proper way of achieving that effect...