i'm have a webapp with images on one of the pages. Storage i use Firebase and to optimise, i use Imagekit. Code is React and Javascript.
I noticed that when i use Firebase Storage function listAll()
to render all images, everytime i refresh, the image order is different.
useEffect(() => {
listAll(imageListRef.current).then((response) => {
response.items.forEach((item) => {
// console.log(item);
getDownloadURL(item).then((url) => {
setImageList((prev) => [...prev, url]);
});
});
});
}, []);
Why is the image order changed on every refresh?