Whenever I try to use Link within MenuItem it shows
Warning: validateDOMNesting(...): cannot appear as a descendant of . See Sidebar > MenuItem > ListItem > EnhancedButton > a > ... > Link > a.
Also, when I click the link I get in that place circle background in black.
MenuItem wraps it's children inside an <a></a>
element, hence the error. We'll try to fix it as it causes to many issues. But if you're in a hurry a PR is always welcome ^_^
Well I'm still at 0.13.4 at my project (and I need to release version 0.1 asap - especially that as you can see I'm sitting at christmas eve ;)). after that I might give it a try.
And about well I could expect that - I simply thought that maybe I was using it in improper way.
Merry Christmas anyway :+1:
Use the containerElement
with linkButton
props!
see:
http://stackoverflow.com/questions/32106513/material-ui-menu-using-routes/34507786#34507786
<MenuItem
linkButton
containerElement={<Link to="/profile" />}
primaryText="Profile"
leftIcon={
<FontIcon className="material-icons">people</FontIcon>
} />
This was fixed with #2708
Another workaround for this issue is to use <LinkContainer>
from https://github.com/react-bootstrap/react-router-bootstrap
Most helpful comment
Use the
containerElement
withlinkButton
props!see:
http://stackoverflow.com/questions/32106513/material-ui-menu-using-routes/34507786#34507786