Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6c88b4e

Browse filesBrowse files
committed
fix: resolve TS warnings
1 parent 6efbe30 commit 6c88b4e
Copy full SHA for 6c88b4e

File tree

1 file changed

+9
-4
lines changed
Filter options

1 file changed

+9
-4
lines changed

‎src/CIcon.tsx

Copy file name to clipboardExpand all lines: src/CIcon.tsx
+9-4Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.