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> = ({
7272 className ,
7373 )
7474
75- const dropdownMenuComponent = ( style ?: React . CSSProperties , ref ?: React . Ref < any > , ) => {
75+ const dropdownMenuComponent = ( style ?: React . CSSProperties , ref ?: React . Ref < HTMLDivElement > ) => {
7676 return (
7777 < Component
7878 className = { _className }
7979 ref = { ref }
8080 style = { style }
8181 role = "menu"
8282 aria-hidden = { ! visible }
83- // isReferenceHidden={false}
8483 { ...( ! popper && { 'data-coreui-popper' : 'static' } ) }
8584 { ...rest }
8685 >
Original file line number Diff line number Diff line change @@ -3,25 +3,23 @@ import PropTypes from 'prop-types'
33import classNames from 'classnames'
44import { CNavLink , CNavLinkProps } from './CNavLink'
55
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 } >
1418 { children }
15- </ CNavLink >
19+ </ li >
1620 )
17- }
18- return (
19- // @ts -expect-error
20- < li className = { _className } ref = { ref } >
21- { children }
22- </ li >
23- )
24- } )
21+ } ,
22+ )
2523
2624CNavItem . propTypes = {
2725 children : PropTypes . node ,
Original file line number Diff line number Diff line change @@ -26,16 +26,13 @@ export const CSidebarNav = forwardRef<HTMLUListElement, CSidebarNavProps>(
2626 const classes = classNames ( 'sidebar-nav' , className )
2727 return (
2828 < ul className = { classes } ref = { ref } { ...rest } >
29- { /* {children} */ }
3029 < 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+ } ) }
3936 </ CNavContext . Provider >
4037 </ ul >
4138 )
You can’t perform that action at this time.
0 commit comments