Closed nilsi closed 4 years ago
Hi, if you want to cache images then your approach is good enough and you can stick with it.
One of the options is to implement such cache behavior in InlineSvg. But I think it is pretty rare use-case and should not be a part of InlineSvg. Instead, you can use your approach or even create a special wrapper component, which will accept a list of images, render list of <inline-svg>
components and remove them, when images are loaded.
What I think could be a good part of InlineSvg, is an option, to preserve display of the old image, when a new one is loading. It should prevent flickering. I'll try to work on it when I will have spare time. Also, PRs are welcome :)
Hi,
I have an issue where my component is flickering as my images are loading the first time.
Is there any way to cache all images in a folder before hand so that I can avoid this flickering? For example cache all images in "../assets/cached"
My code looks like this. When I click on the image and next is loaded there is some white flickering really fast.
If I instead test to load all images before like this it works as I wanted it and there is no flicker when I click the last one.
Hope you understand my issue here. Thanks.