Building out a Nav from JSON. If an item has children I need to run some before and after code around the children's loop. My if statement works and all singles are created correctly. It creates the dropdown component however the inner loop isn't running. It's reading it as html.
render() {
return menuLocal.items.map((menu, i) => {
return (
<div key={i}>
{(menu.children) ? (
<UncontrolledDropdown nav inNavbar>
<DropdownToggle nav caret>
{menu.title}
</DropdownToggle>
<DropdownMenu right>
menu.children.map((children, i) => {
<NavItem key={'children-'+i}>
<Link to={menu.object_slug} className="nav-link">{menu.title}</Link>
</NavItem>
})
</DropdownMenu>
</UncontrolledDropdown>
):
<NavItem>
<Link to={menu.object_slug} className="nav-link">{menu.title}</Link>
</NavItem>
}
</div>
)
})
}
Here is a live link that shows the issue in the Nav. http://attorneytemplate.netlify.com/