There is the remote array that I have to fetch in React Native.
I can return "name" in the array but I can't return url
in the array in an array.
This is my array.
{
"data": [
{
"id": 1,
"attributes": {
"name": "Apple",
"media": {
"data": [
{
"id": 12,
"attributes": {
"url": "https://example.com/1.jpg"
}
}
]
}
}
},
{
"id": 2,
"attributes": {
"name": "Banana",
"media": {
"data": [
{
"id": 11,
"attributes": {
"url": "https://example.com/2.jpg"
}
}
]
}
}
}
],
}
This is my React Native code.
<Text>{`${item.attributes.name}`}</Text>
<Image
source={{ uri: item.attributes.media.??? }}
style={styles.image}
/>