I'm new to react native and want to loop trough a nested object. I created a file named 'spots.js' i looks like this:
export {spots};
var spots = [
{
name: 'Barberistas',
location: 'Geleen',
img_url: require('../assets/snipes/coffeesnipe-barberistas.jpg'),
isFavourite: false,
imagesReviews:{
img1: require('../assets/snipes/coffeesnipe-barberistas.jpg'),
img2: require('../assets/snipes/coffeesnipe-barberistas.jpg'),
img3: require('../assets/snipes/coffeesnipe-barberistas.jpg'),
}
},
]
Now i'm trying to show the images from 'spots' of imagesReviews. I know how i loop trough a object but i'm stucked with this nested object. At the moment i have this:
<ScrollView horizontal={true}>
{
spots.map((l) => {
return <Image source={ l.imagesReviews }></Image>
})
}
</ScrollView>
Screenshot of structure: enter image description here
Is there someone who can help me show those pictures in this scrollview? I imported everything the correct way, my only question is how can i loop trough that nested object and only show the imagesReviews?