Skip to content

Commit 76a0ef5

Browse files
committed
fix(iconUtils): update renderIcon function to use IconType for improved type safety
1 parent a1ec1f4 commit 76a0ef5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

frontend/src/utils/iconUtils.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import React from 'react';
2+
import type { IconType } from 'react-icons';
23

34
/**
45
* Utility function to wrap react-icons components for React 19 compatibility
56
* This ensures that icon components return valid JSX elements instead of ReactNode
67
*/
78
export const renderIcon = (
8-
IconComponent: React.ComponentType<React.SVGProps<SVGSVGElement>>,
9+
IconComponent: IconType,
910
props?: React.SVGProps<SVGSVGElement>
1011
): React.JSX.Element => {
1112
return React.createElement(IconComponent, props);

0 commit comments

Comments
 (0)