File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1- import React from 'react'
1+ import React , { isValidElement } from 'react'
22import PropTypes from 'prop-types'
33import classNames from 'classnames'
44import { CLink , CBadge } from '../index'
@@ -35,7 +35,7 @@ const CSidebarNavItem = props => {
3535 addLinkClass
3636 )
3737
38- const routerLinkProps = rest . to && { exact : true , activeClassName : 'c-active' }
38+ const routerLinkProps = rest . to && { exact : true , activeClassName : 'c-active' }
3939 return (
4040 < li className = { classes } ref = { innerRef } >
4141 { children ||
@@ -44,7 +44,7 @@ const CSidebarNavItem = props => {
4444 { ...routerLinkProps }
4545 { ...rest }
4646 >
47- { icon && < CIcon { ...iconProps ( icon ) } /> }
47+ { icon && isValidElement ( icon ) ? icon : < CIcon { ...iconProps ( icon ) } /> }
4848 { fontIcon && < i className = { `c-sidebar-nav-icon ${ fontIcon } ` } /> }
4949 { name }
5050 { badge && < CBadge { ...{ ...badge , text : null } } > { badge . text } </ CBadge > }
You can’t perform that action at this time.
0 commit comments