I have some folders on Firebase Storage. Every folder includes 1_org_zoom.jpg file. I can get those photos, but not in the right array order. I want to get those photos in an order like the photo below, but photos are shown randomly. I tried for loop and forEach, but didn't work. Is there any way to get these photos in an order?
useEffect(() => {
/* for(let i = 0; i<products.length; i++){
const imgRef = ref(storage, imgFolderRef[i]);
console.log(imgRef);
getDownloadURL(imgRef)
.then((url) => {
console.log(url);
})
}
*/
/* imgFolderRef.forEach((imgFolder) => {
console.log(imgFolder);
getDownloadURL(ref(storage, imgFolder))
.then((url) => {
setExArr((oldArr) => [...oldArr, url])
})
})
}, [products]);
*/
Array name is imgFolderRef.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment