Array [
Object {
"resultlist": Array [
Object {
"img": "https://www.act.com/image/cache/catalog/new%20thumbnails/Mifa%20A1BlacjkThumbnail-600x600.jpg",
"name": "Mifa F1",
"product_id": 87,
"type": "product",
},
Object {
"category_id": 20,
"img": "https://www.achhacart.com/image/catalog/cmsblock/hgb5.png",
"name": "Earphone",
"type": "category",
},
Object {
"img": "https://www.achhacart.com/image/catalog/cmsblock/air.gif",
"name": "Air Purifier",
"product_id": 87,
"type": "product",
},
Object {
"img": "https://www.achhacart.com/image/catalog/cmsblock/Powerbank10.jpg",
"name": "Powerbank",
"product_id": 87,
"type": "product",
},
],
"sort_order": 0,
"status": true,
"type": "product",
},
Object {
"img": "https://www.act.com/image/catalog/cmsblock/Powerbank10.jpg",
"product_id": 187,
"sort_order": 1,
"status": true,
"type": "middleimage",
},
Object {
"resultlist": Array [
Object {
"img": "https://www.act.com/image/cache/catalog/new%20thumbnails/Mifa%20A1BlacjkThumbnail-600x600.jpg",
"name": "Mifa A1 Black",
"product_id": 87,
"type": "product",
},
Object {
"category_id": 20,
"img": "https://www.act.com/image/catalog/cmsblock/hgb5.png",
"name": "Earphones",
"type": "category",
},
Object {
"img": "https://www.act.com/image/catalog/cmsblock/air.gif",
"name": "Air Purifiers",
"product_id": 87,
"type": "product",
},
Object {
"img": "https://www.act.com/image/catalog/cmsblock/Powerbank10.jpg",
"name": "Powerbanks",
"product_id": 87,
"type": "product",
},
],
"sort_order": 2,
"status": true,
"type": "product",
},
Object {
"resultlist": Array [
Object {
"image": "https://www.act.com/simage/catalog/1AA/WeChatImage_20191228151402.jpg",
"link": "",
"title": "slider1",
},
Object {
"image": "https://www.act.com/staging-achhamall.com/image/catalog/1accc/WeChatImage_20191231125513.jpg",
"link": "",
"title": "slider2",
},
],
"sort_order": 3,
"status": true,
"type": "slider",
},
]
this is my json response and i want to fetch all my response object with array object and i have tried as:-
{data.map((item, i) =>
<View>
<Text key={i}>{item.type}</Text>
{
item.resultlist.map((sub,index)=>
<Text key={index}>sub.name</Text>
)}
</View>
)}
using item then for inside i used sub with index
but then error showsthat
undefined is not an object (evaluating 'item.resultlist.map')
how to fetch this nested arrays object or something is wrong with my response json please suggest me where i am wrng? and mostly when i try to fetch the single object inside the array's object with
let products = responseJson.response[0].resultlist[3];
then with console i can fetch only single object but when using this map function to fetch then its undefined