diff --git a/README.md b/README.md index a78a7fd..b34c211 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,10 @@ expanded | boolean | false | Whether the navigation item is expanded or collapse eventKey | any | _(required)_ | Value passed to the `onSelect` handler, useful for identifying the selected navigation item. onClick | function(event) | | Callback fired when the navigation item is clicked. onSelect | function(eventKey, event) | | Callback fired when a navigation item is selected. +navitemClassName | | | +navitemStyle | | | +subnavClassName | | | +subnavStyle | | | #### NavIcon diff --git a/src/NavItem.jsx b/src/NavItem.jsx index e95338a..60e5bc0 100644 --- a/src/NavItem.jsx +++ b/src/NavItem.jsx @@ -98,6 +98,12 @@ class NavItem extends PureComponent { // Sub navigation item subnav, + // Override className and style + navitemClassName, + navitemStyle, + subnavClassName, + subnavStyle, + // Default props className, style, @@ -122,7 +128,8 @@ class NavItem extends PureComponent { >
+ {navIcon && navIcon.props &&
- {navIcon && navIcon.props ? navIcon.props.children : null} + {navIcon.props.children}
+ } + {navText && navText.props &&
- {navText && navText.props ? navText.props.children : null} + {navText.props.children}
+ }
); @@ -188,7 +199,8 @@ class NavItem extends PureComponent { >
+ {navIcon && navIcon.props &&
- {navIcon && navIcon.props ? navIcon.props.children : null} + {navIcon.props.children}
+ } + {navText && navText.props &&
- {navText && navText.props ? navText.props.children : null} + {navText.props.children}
+ } {others}
{(navItems.length > 0) &&