Possible bug, <Nav /> gives wrong behavior on *icon* and *onClick* attrs
Bug Report
- Package version(s): "office-ui-fabric-react": "^4.30.0"
- Browser and OS versions: Chrome 60
Priorities and help requested (not applicable if asking question):
Are you willing to submit a PR to fix? (Yes, No)
Requested priority: (Blocking, High, Normal, Low) Normal
Products/sites affected: (if applicable)
Describe the issue:
<Nav
groups={
[
{
links:
[
{
name: 'Home',
icon: 'Edit',
url: '',
links: [{
name: 'Activity',
url: '',
icon: 'Edit',
key: 'key1'
},
{
name: 'News',
url: '',
onClick: (e) => {},
icon: 'Edit',
key: 'key2'
}],
isExpanded: true
},
]
}
]
}
selectedKey={ 'key1' }
/>
Actual behavior:
- The first menu 'Activity' has no icon.
- The second menu is highlighted(selected).
Expected behavior:
- The first menu 'Activity' has a mail icon.
- The second menu should not be highlighted(selected).

I did a bit of investigation. All of these issues arise from the unresolved differences between _renderAnchorLink and _renderButtonLink.
_renderAnchorLink does not observe the icon property, which is why it doesn't show up for Activity in your repro
_renderButtonLink uses CommandButton, whereas _renderAnchorLink "rolls its own" for styling, and the two are not in sync. The CommandButton styles are what's rendering "News" in the themePrimary color.
As a separate issue, I'm not sure of the design intention when rendering items with and without icons side-by-side; whether we want to keep the text aligned with each other, or have the current effect you see in the repro.
If @mikewheaton or another Fabric designer can clarify the design intent of this component, I can resolve the differences highlighted in this bug one way or another.
@MLoughry thanks a lot for your reviewing
@Aaron2Ti Nav has had some refactoring and I can't repro this bug anymore. I'm going to go ahead and close this issue, please reopen if you continue to experience issues with it
@erichdev thanks a lot