how to download several files (photos) from firebase storage at once using react?

Issue

This Content is from Stack Overflow. Question asked by Windy

i’m trying to download images from firebase storage and i’m getting it but with only one photo which i pass in the link. How to make it so that all the photos that are in the storage are loaded at once?

const storage = getStorage();
const starsRef = ref(storage, 'gs://wal1-papers.appspot.com/files/wallpaper.png')
getDownloadURL(starsRef)
.then((url) => {
  console.log(url)
})
.catch((error) => {
  switch (error.code) {
    case 'storage/object-not-found':
      break;
    case 'storage/unauthorized':
      break;
    case 'storage/canceled':
      break;

    case 'storage/unknown':
      break;
  }
});
        <div>
          <img style={{width: '100%'}} src='https://firebasestorage.googleapis.com/v0/b/wal1- 
          papers.appspot.com/o/files%2Fwallpaper.png?alt=media&token=932b121d-0620-4f5d-9487- 
          763c8d549dbc' />
          <hr/> 
        </div> 



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?