I have JSON data like this. I want to render the child object title. But it says "index.js:1 Warning: Each child in a list should have a unique "key" prop."
[
{
"title": "Components",
"children": [
{
"title": "Buttons",
"url": "url"
}
]
},
{
"title": "Components",
"children": [
{
"title": "Buttons",
"url": "url"
}
]
}
]
How can I get children title? {data.children.title} does not work.
const items = data.map(data => {
return(
<div>
<ul>
<li>
<span>{data.title}</span>
<span>{data.children.title}</span>
</li>
</ul>
</div>
)
});
return items;