I simply want to get download urls from firestorage and push it to empty array.
In handleSubmit I try this but it logs empty array.. if I try it inside it logs correctly
let images = [];
thumbnail.forEach(async (file) => {
const uploadPath = `property/${user.uid}/${file.name}`;
const imgRef = ref(storage, uploadPath);
await uploadBytes(imgRef, file);
images.push(await getDownloadURL(imgRef));
console.log(images); //Logs correct array of urls
});
console.log(images);// Logs empty array