From f0ea95d2af52e7e2dd52727315950f98398d8c2e Mon Sep 17 00:00:00 2001 From: unix Date: Sun, 29 Mar 2020 06:21:57 +0800 Subject: [PATCH] fix(avatar): fix union types for different elements --- components/avatar/avatar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/avatar/avatar.tsx b/components/avatar/avatar.tsx index f7707fe..c881443 100644 --- a/components/avatar/avatar.tsx +++ b/components/avatar/avatar.tsx @@ -21,8 +21,8 @@ const defaultProps = { className: '', } -type NativeAttrs = React.ImgHTMLAttributes | React.HTMLAttributes -export type AvatarProps = Props & typeof defaultProps & NativeAttrs +type NativeAttrs = React.ImgHTMLAttributes & React.HTMLAttributes +export type AvatarProps = Props & typeof defaultProps & Partial const getAvatarSize = (size: NormalSizes | number): string => { if (typeof size === 'number') return `${size}px`