The following below are my codes
I would like to put a dropdown on my UI Elements and Tables on my navbar having trouble to do it
My current Output
Ideal Output
LayoutMain.js
{links.map(({ icon: Icon, ...link }, index) => (
<ListItem
button
key={link.name}
onClick={() => gotoRoute(link.route)}
selected={link.route === location.pathname}
>
<ListItemIcon>
<Icon />
</ListItemIcon>
<ListItemText primary={link.name} />
</ListItem>
))}
</List>
Links.js
export const links = [
{
name: 'Dashboard',
icon: Dashboard,
route: '/',
},
{
name: 'UI Elements',
icon: ListAlt,
route: '/UIElements',
},
{
name: 'General',
icon: RadioButtonUnchecked,
route: '/General',
},
{
name: 'Tables',
icon: TableChart,
route: '/Tables'
}
];
question from:
https://stackoverflow.com/questions/66048634/im-new-to-reactjs-and-material-ui-i-would-like-to-create-a-drop-down-in-my-nav 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…