How to do routing with material-ui@next MenuItem?
You can use Link
as parent component for MenuItem
:
<MenuList>
<Link to="/myRoute" style={{ textDecoration: 'none', display: 'block' }}>
<MenuItem>
go to my route
</MenuItem>
</Link>
<Link to="/anotherRoute" style={{ textDecoration: 'none', display: 'block' }}>
<MenuItem>
go to another route
</MenuItem>
</Link>
</MenuList>
you can now give the MenuItem
a component prop like this:
<MenuItem component={Link} to='/myRoute'>
go to my route
</MenuItem>