8000 fix: resolve TS warnings · coreui/coreui-icons-react@6c88b4e · GitHub
[go: up one dir, main page]

Skip to content

Commit 6c88b4e

Browse files
committed
fix: resolve TS warnings
1 parent 6efbe30 commit 6c88b4e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/CIcon.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ export interface CIconProps extends Omit<HTMLAttributes<SVGSVGElement>, 'content
5353
* If defined component will be rendered using 'use' tag.
5454
*/
5555
use?: string
56+
/**
57+
* The viewBox attribute defines the position and dimension of an SVG viewport.
58+
*/
59+
viewBox?: string
5660
/**
5761
* Title tag content.
5862
*/
@@ -108,8 +112,8 @@ export const CIcon = forwardRef<SVGSVGElement, CIconProps>(
108112
return _icon
109113
}
110114

111-
if (typeof _icon === 'string' && React['icons']) {
112-
return React['icons'][iconName as string]
115+
if (typeof _icon === 'string' && (React as { [key: string]: any })['icons']) {
116+
return (React as { [key: string]: any })[iconName as string]
113117
}
114118
}, [change])
115119

@@ -193,8 +197,9 @@ CIcon.propTypes = {
193197
'8xl',
194198
'9xl',
195199
]),
196-
title: PropTypes.any,
197-
use: PropTypes.any,
200+
title: PropTypes.string,
201+
use: PropTypes.string,
202+
viewBox: PropTypes.string,
198203
width: PropTypes.number,
199204
}
200205

0 commit comments

Comments
 (0)
0