Skip to content

Commit 154aa3d

Browse files
committedSep 19, 2023
type(Avatar): fix icon type error.
1 parent 2d2c9af commit 154aa3d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

Diff for: ‎packages/react-avatar/src/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Icon, { IconProps } from '@uiw/react-icon';
2+
import Icon, { IconProps, TagType } from '@uiw/react-icon';
33
import { HTMLSpanProps, noop } from '@uiw/utils';
44
import './style/index.less';
55
import { useState } from 'react';
@@ -9,7 +9,7 @@ export interface AvatarProps extends HTMLSpanProps {
99
style?: React.CSSProperties;
1010
className?: string;
1111
prefixCls?: string;
12-
icon?: IconProps['type'];
12+
icon?: IconProps<TagType>['type'];
1313
alt?: string;
1414
src?: string;
1515
size?: 'large' | 'default' | 'small' | 'mini';

Diff for: ‎packages/react-icon/src/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import svgPaths from '@uiw/icons/fonts/w-icon.json';
33
import './style/index.less';
44

55
export type IconsName = keyof typeof svgPaths;
6-
type TagType = React.ElementType | keyof JSX.IntrinsicElements;
6+
export type TagType = React.ElementType | keyof JSX.IntrinsicElements;
77
type ElementProps<T extends TagType, E = React.ReactElement> = {
88
fill?: string;
99
style?: React.CSSProperties;

0 commit comments

Comments
 (0)
Please sign in to comment.