Estoy usando el almacenamiento de firebase para cargar las imágenes y luego almacenar las direcciones URL en firebase db. Lo estoy usando para cargar la lista de imágenes, pero el siguiente código funciona bien en firebase v8 pero no en la versión 9
export const multiImageUpload = async (path = "Products", imageFileList) => { let imagesUrlArray = []; let imageUrl = ""; // array of files let arr = imageFileList.map((item) => { return item.originFileObj; }); for (let i = 0; i < arr.length; i++) { const upload = await storage.ref(`/${path}/${arr[i].name}`).put(arr[i]); imageUrl = await upload.ref.getDownloadURL(); imagesUrlArray.push(imageUrl); } return imagesUrlArray; // array of URLS of uploaded files };arroja un error de que ref.put no es una función, guíeme por qué recibo ese error.
importar { ref, getDownloadURL, uploadBytesResumable, uploadBytes } desde 'firebase/storage';
// Upload the multiple images const multiImage = async (imageFileList) => { /* eslint no-var: 0 */ const imagesUrlArray = []; /* eslint no-var: 0 */ for (let i = 0; i < imageFileList.length; i++) { const id = uuidv4(); const metadata = { contentType: 'image/jpeg' }; /* eslint-disable no-await-in-loop */ const storageRef = ref(storage, `images/${id}`); const upload = await uploadBytes(storageRef, imageFileList[i], metadata); const imageUrl = await getDownloadURL(storageRef); imagesUrlArray.push(imageUrl); } return imagesUrlArray; // array of URLS of uploaded files };