Here is my Jason data and code that i am using map() for populating my data but getting some error, below is my code
var data = [
{
categorytitle: "Shoes",
category: [
{
Category1: "Boots"
},
{
Category2: "Sneakers"
},
{
Category3: "Flats"
},
{
Category4: "Booties"
},
{
Category5: "Mules"
},
{
Category6: "Heels/Pumps"
},
{
Category7: "Clogs"
},
{
Category8: "Slippers"
},
{
Category9: "Sandals"
},
{
Category10: "Sale"
},
{
Category11: "Shop All"
}
]
}
];
also please find the populating code at below...
{data.map((el, e) => (
<div {...el} key={e}>
<h3>{el.categorytitle}</h3>
<ul>
<li>{el.category[e]}</li>
</ul>
</div>
))}
Please guide me how i can display Category1 .... in list?
Objects are not valid as a React child (found: object with keys {Category1}). If you meant to render a collection of children, use an array instead.