File tree 1 file changed +3
-3
lines changed
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'
2
2
import PropTypes from 'prop-types'
3
3
import classNames from 'classnames'
4
4
import { CLink , CBadge } from '../index'
@@ -35,7 +35,7 @@ const CSidebarNavItem = props => {
35
35
addLinkClass
36
36
)
37
37
38
- const routerLinkProps = rest . to && { exact : true , activeClassName : 'c-active' }
38
+ const routerLinkProps = rest . to && { exact : true , activeClassName : 'c-active' }
39
39
return (
40
40
< li className = { classes } ref = { innerRef } >
41
41
{ children ||
@@ -44,7 +44,7 @@ const CSidebarNavItem = props => {
44
44
{ ...routerLinkProps }
45
45
{ ...rest }
46
46
>
47
- { icon && < CIcon { ...iconProps ( icon ) } /> }
47
+ { icon && isValidElement ( icon ) ? icon : < CIcon { ...iconProps ( icon ) } /> }
48
48
{ fontIcon && < i className = { `c-sidebar-nav-icon ${ fontIcon } ` } /> }
49
49
{ name }
50
50
{ badge && < CBadge { ...{ ...badge , text : null } } > { badge . text } </ CBadge > }
You can’t perform that action at this time.
0 commit comments