Я создаю приложение, используя expo и response-native.
Я пытаюсь загрузить фотографии из firebase, используя async await и функцию map с Promise.all, но все, что я получаю, это массив неразрешенных обещаний.
renderImages = async () => {
const images = [];
if(this.state.images.length > 0) {
images = this.state.images.map( async (item, index) => {
const ref = firebase.storage().ref(item);
var image = await ref.getDownloadURL()
return <View><Image source={{ uri: image}} /></View>
})
const imageArray = await Promise.all(images);
return imageArray || [];
}
return <View><Text>STATE.IMAGES.LENGTH is 0</Text></View>
}
все, что я получаю, это
Promise {
"_40": 0,
"_55": null,
"_65": 0,
"_72": null,
}