mirror of
https://github.com/zhigang1992/react.git
synced 2026-02-13 09:11:21 +08:00
fix(avatar): fix union types for different elements
This commit is contained in:
@@ -21,8 +21,8 @@ const defaultProps = {
|
||||
className: '',
|
||||
}
|
||||
|
||||
type NativeAttrs = React.ImgHTMLAttributes<any> | React.HTMLAttributes<any>
|
||||
export type AvatarProps = Props & typeof defaultProps & NativeAttrs
|
||||
type NativeAttrs = React.ImgHTMLAttributes<any> & React.HTMLAttributes<any>
|
||||
export type AvatarProps = Props & typeof defaultProps & Partial<NativeAttrs>
|
||||
|
||||
const getAvatarSize = (size: NormalSizes | number): string => {
|
||||
if (typeof size === 'number') return `${size}px`
|
||||
|
||||
Reference in New Issue
Block a user