I am using
import { Nav } from 'office-ui-fabric-react';
function CustomNav(props) {
return <Nav groups={groups} selectedKey={selectedKey} onLinkClick={handleLinkClick} data-myTag="hello" />;
}
For nav object, I want to add custom html attributes such as data-myTag. How do I add this attribute to the button that is added to the DOM by this Nav object.
Based on looking at the source where
Navis rendered, it unfortunately looks like it isn't possible to add data tags to the container.Your best bet would likely be to either:
divyou return from yourCustomNavcomponent, or