So I'm trying to show the json data that I got and I succesfully show the data from "MenuRole" except data from "cmsmenuschild" array object.I'm tried my best to figure out how to show the from that it keep error all the time,does anyone know what's wrong with that or any other way to show the data inside "cmsmenuschild" in my json data?.any help would be really appreciate.
json data
"MenuRole": [ { "id": 1, "name": "Manage User", "icon": "ion-person", "path_fe": "dashboard/user", "cmsmenuschild": [ { "name": "Create User", "cmsprivilegesroles": { "is_allowed": 1 } }, { "name": "Update User", "cmsprivilegesroles": { "is_allowed": 1 } }, ], }, ] Sidebar.js
class Sidebar extends Component { constructor(props) { super(props); this.state = { MenuRole: [], }; } getMenus = () => { return this.state.MenuRole.map((role, index) => (<Menu.Item key={role.name}> <Link to={ { pathname: `/${role.path_fe}`, }} > <i className={role.icon} /> <span className="nav-text"> <span>{role.name}</span> <span>{role.cmsmenuschild.name}</span> <span>{role.cmsmenuschild[0].cmsprivilegesroles.is_allowed}</span> <span>{role.cmsmenuschild[1].cmsprivilegesroles.is_allowed}</span> </span> </Link> </Menu.Item>)); } render() { return( <div> {this.getMenus()} </div> ); } }