This is the generated code, because the list is created by the routes of the pages, I would like to know a way to delete a specific Navlink, either by the key or by another way definitely, that Navlink should be eliminated when the page is loaded .
<NavLink Key='0' to="/pag1" activeClassName="active" arriaCurrent="true">
<NavLink Key='1' to="/pag2" activeClassName="active" arriaCurrent="true">
<NavLink Key='2' to="/pag3" activeClassName="active" arriaCurrent="true">
<NavLink Key='3' to="/pag4" activeClassName="active" arriaCurrent="true">
<NavLink Key='4' to="/pag5" activeClassName="active" arriaCurrent="true">
This is the code for how NavLinks are generated
<List className={classes.list}>
{
routes.map((prop,key) => {
if(prop.redirect)
return null;
return (
<NavLink to={prop.path} activeClassName="active" key={key}>
<div className = "btnMenu">
<ListItem button className={classes.itemLink + (this.activeRoute(prop.path) ? " " + classes[color]:"" )}>
<ListItemIcon className={classes.itemIcon + (this.activeRoute(prop.path) ? " " + classes.whiteFont:"")}>
<prop.icon />
</ListItemIcon>
<ListItemText primary={prop.sidebarName} className={classes.itemText + (this.activeRoute(prop.path) ? " " + classes.whiteFont:"")} disableTypography={true}/>
</ListItem>
</div>
</NavLink>
);
if(key=[4]) {
return(
<teste/>
)
}
})
}
</List>