File tree Expand file tree Collapse file tree 3 files changed +22
-28
lines changed Expand file tree Collapse file tree 3 files changed +22
-28
lines changed Original file line number Diff line number Diff line change @@ -72,15 +72,14 @@ export const CDropdownMenu: FC<CDropdownMenuProps> = ({
72
72
className ,
73
73
)
74
74
75
- const dropdownMenuComponent = ( style ?: React . CSSProperties , ref ?: React . Ref < any > , ) => {
75
+ const dropdownMenuComponent = ( style ?: React . CSSProperties , ref ?: React . Ref < HTMLDivElement > ) => {
76
76
return (
77
77
< Component
78
78
className = { _className }
79
79
ref = { ref }
80
80
style = { style }
81
81
role = "menu"
82
82
aria-hidden = { ! visible }
83
- // isReferenceHidden={false}
84
83
{ ...( ! popper && { 'data-coreui-popper' : 'static' } ) }
85
84
{ ...rest }
86
85
>
Original file line number Diff line number Diff line change @@ -3,25 +3,23 @@ import PropTypes from 'prop-types'
3
3
import classNames from 'classnames'
4
4
import { CNavLink , CNavLinkProps } from './CNavLink'
5
5
6
- export const CNavItem = forwardRef <
7
- HTMLButtonElement | HTMLAnchorElement | HTMLLIElement ,
8
- CNavLinkProps
9
- > ( ( { children, className, ...rest } , ref ) => {
10
- const _className = classNames ( 'nav-item' , className )
11
- if ( rest . href || rest . to ) {
12
- children = (
13
- < CNavLink className = { className } { ...rest } ref = { ref } >
6
+ export const CNavItem = forwardRef < HTMLLIElement , CNavLinkProps > (
7
+ ( { children, className, ...rest } , ref ) => {
8
+ const _className = classNames ( 'nav-item' , className )
9
+ if ( rest . href || rest . to ) {
10
+ children = (
11
+ < CNavLink className = { className } { ...rest } >
12
+ { children }
13
+ </ CNavLink >
14
+ )
15
+ }
16
+ return (
17
+ < li className = { _className } ref = { ref } >
14
18
{ children }
15
- </ CNavLink >
19
+ </ li >
16
20
)
17
- }
18
- return (
19
- // @ts -expect-error
20
- < li className = { _className } ref = { ref } >
21
- { children }
22
- </ li >
23
- )
24
- } )
21
+ } ,
22
+ )
25
23
26
24
CNavItem . propTypes = {
27
25
children : PropTypes . node ,
Original file line number Diff line number Diff line change @@ -26,16 +26,13 @@ export const CSidebarNav = forwardRef<HTMLUListElement, CSidebarNavProps>(
26
26
const classes = classNames ( 'sidebar-nav' , className )
27
27
return (
28
28
< ul className = { classes } ref = { ref } { ...rest } >
29
- { /* {children} */ }
30
29
< CNavContext . Provider value = { CNavContextValues } >
31
- {
32
- // @ts -expect-error
33
- React . Children . map ( children , ( child , index ) => {
34
- if ( React . isValidElement ( child ) ) {
35
- return React . cloneElement ( child , { key : index , idx : index } )
36
- }
37
- } )
38
- }
30
+ { React . Children . map ( children , ( child , index ) => {
31
+ if ( React . isValidElement ( child ) ) {
32
+ return React . cloneElement ( child , { key : index , idx : `${ index } ` } )
33
+ }
34
+ return
35
+ } ) }
39
36
</ CNavContext . Provider >
40
37
</ ul >
41
38
)
You can’t perform that action at this time.
0 commit comments