We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
icon
1 parent df6d3b9 commit 03c4c32Copy full SHA for 03c4c32
src/template/CSidebarNavDropdown.js
@@ -2,7 +2,8 @@ import React, {
2
useState,
3
useContext,
4
useEffect,
5
- createRef
+ createRef,
6
+ isValidElement
7
} from 'react'
8
import PropTypes from 'prop-types'
9
import classNames from 'classnames'
@@ -100,7 +101,7 @@ const CSidebarNavDropdown = props => {
100
101
ref={ref}
102
>
103
<a className="c-sidebar-nav-dropdown-toggle" onClick={toggle} >
- { icon && <CIcon {...iconProps(icon)} /> }
104
+ { icon && (isValidElement(icon) ? icon : <CIcon {...iconProps(icon)}/>) }
105
{ fontIcon && <i className={iconClasses}/> }
106
{ name }
107
</a>
@@ -121,7 +122,6 @@ CSidebarNavDropdown.propTypes = {
121
122
fontIcon: PropTypes.string,
123
show: PropTypes.bool,
124
route: PropTypes.string
-};
125
-
+}
126
127
export default CSidebarNavDropdown
0 commit comments