Hey guys Im trying to make a menu that renders the menu items from this json data.
Im doing this using react so just trying to get the correct syntax around it, here is the data,
{
"name": "menu",
"children": [
{
"title": "Account",
"children": [
{
"name": "Preferences"
},
{
"name": "Contact Details"
},
{
"name": "Manage Users"
}
]
},
{
"title": "Design",
"children": [
{
"name": "Themes"
},
{
"name": "Gallery"
},
{
"name": "Templates"
}
]
},
currently I'm mapping over it and can only get access to the title,
{menu.map((item, i) => (
<div key={i}>
<h2>{item.title}</h2>
</div>
))}
</div>
whats the correct way to get access to the children array within the data so I can then render out the items with an onclick or something ?
cheers