Skip to content

Commit fd89010

Browse files
committed
fix: 修复升级react造成的 svgIcon hook的类型报错
1 parent d3a24a6 commit fd89010

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/hooks/src/use-svg-icon-render.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createElement } from 'react';
2+
import type { ReactElement } from 'react';
23

34
interface IconConfig {
45
/** Icon color */
@@ -24,7 +25,7 @@ interface Props {
2425
*
2526
* @param SvgIcon Svg icon component
2627
*/
27-
export default function useSvgIconRender(SvgIcon: ({ className, icon, localIcon, style }: Props) => JSX.Element) {
28+
export default function useSvgIconRender(SvgIcon: ({ className, icon, localIcon, style }: Props) => ReactElement) {
2829
type IconStyle = Partial<Pick<CSSStyleDeclaration, 'color' | 'fontSize'>>;
2930

3031
/**

0 commit comments

Comments
 (0)