this is my code to call arrays of object
{data.map((item, index ) =>
<View>
<Text key={index}>{item.type}</Text>
{item.resultlist((sub,index)=>
<Text key={index}>{sub.name}</Text>
)}
</View>
)}
and this is my response of json array
{
"status": "success",
"message": "Home page Response",
"response": [
{
"type": "product",
"status": true,
"sort_order": 0,
"resultlist": [
{
"name": "Mifa F1",
"img": "https://www.achhacart.com/image/cache/catalog/new%20thumbnails/Mifa%20A1BlacjkThumbnail-600x600.jpg",
"type": "product",
"product_id": 87
},
{
"name": "Earphone",
"img": "https://www.achhacart.com/image/catalog/cmsblock/hgb5.png",
"type": "category",
"category_id": 20
},
{
"name": "Air Purifier",
"img": "https://www.achhacart.com/image/catalog/cmsblock/air.gif",
"type": "product",
"product_id": 87
},
{
"name": "Powerbank",
"img": "https://www.achhacart.com/image/catalog/cmsblock/Powerbank10.jpg",
"type": "product",
"product_id": 87
}
]
},
{
"type": "middleimage",
"status": true,
"sort_order": 1,
"img": "https://www.achhacart.com/image/catalog/cmsblock/Powerbank10.jpg",
"product_id": 187
},
{
"type": "product",
"status": true,
"sort_order": 2,
"resultlist": [
{
"name": "Mifa A1 Black",
"img": "https://www.achhacart.com/image/cache/catalog/new%20thumbnails/Mifa%20A1BlacjkThumbnail-600x600.jpg",
"type": "product",
"product_id": 87
},
{
"name": "Earphones",
"img": "https://www.achhacart.com/image/catalog/cmsblock/hgb5.png",
"type": "category",
"category_id": 20
},
{
"name": "Air Purifiers",
"img": "https://www.achhacart.com/image/catalog/cmsblock/air.gif",
"type": "product",
"product_id": 87
},
{
"name": "Powerbanks",
"img": "https://www.achhacart.com/image/catalog/cmsblock/Powerbank10.jpg",
"type": "product",
"product_id": 87
}
]
},
{
"type": "slider",
"status": true,
"sort_order": 3,
"resultlist": [
{
"title": "slider1",
"link": "",
"image": "https://www.achhamall.com/staging-achhamall.com/image/catalog/1AA/WeChatImage_20191228151402.jpg"
},
{
"title": "slider2",
"link": "",
"image": "https://www.achhamall.com/staging-achhamall.com/image/catalog/1accc/WeChatImage_20191231125513.jpg"
}
]
}
]
}
how should i call the sub array inside the whole array function in react native i am using the map function but still the error is same and when i call the array object outside the array object then its render suggest me where i am wrong
item.resultlistshould probably be changed toitem.resultlist.mapresultListon them