diff --git a/components/_util/type.ts b/components/_util/type.ts index 1e00fe20c5..e4d5cd02ea 100644 --- a/components/_util/type.ts +++ b/components/_util/type.ts @@ -1,2 +1,2 @@ /** https://github.com/Microsoft/TypeScript/issues/29729 */ -export type LiteralUnion = T | (U & {}); +export type LiteralUnion = T | (string & {}); diff --git a/components/badge/Ribbon.tsx b/components/badge/Ribbon.tsx index 4da555e0a9..08e6b12fc7 100644 --- a/components/badge/Ribbon.tsx +++ b/components/badge/Ribbon.tsx @@ -13,7 +13,7 @@ export interface RibbonProps { prefixCls?: string; style?: React.CSSProperties; // style of ribbon element, not the wrapper text?: React.ReactNode; - color?: LiteralUnion; + color?: LiteralUnion; children?: React.ReactNode; placement?: RibbonPlacement; } diff --git a/components/badge/index.tsx b/components/badge/index.tsx index a2f689bc89..d61f9e6549 100644 --- a/components/badge/index.tsx +++ b/components/badge/index.tsx @@ -30,7 +30,7 @@ export interface BadgeProps { scrollNumberPrefixCls?: string; className?: string; status?: PresetStatusColorType; - color?: LiteralUnion; + color?: LiteralUnion; text?: React.ReactNode; size?: 'default' | 'small'; offset?: [number | string, number | string]; diff --git a/components/tag/index.tsx b/components/tag/index.tsx index 867c0ddb09..b2df6bb605 100644 --- a/components/tag/index.tsx +++ b/components/tag/index.tsx @@ -15,7 +15,7 @@ export type { CheckableTagProps } from './CheckableTag'; export interface TagProps extends React.HTMLAttributes { prefixCls?: string; className?: string; - color?: LiteralUnion; + color?: LiteralUnion; closable?: boolean; closeIcon?: React.ReactNode; /** @deprecated `visible` will be removed in next major version. */ diff --git a/components/tooltip/index.tsx b/components/tooltip/index.tsx index e3c134806c..760ba8aba2 100644 --- a/components/tooltip/index.tsx +++ b/components/tooltip/index.tsx @@ -71,7 +71,7 @@ interface LegacyTooltipProps export interface AbstractTooltipProps extends LegacyTooltipProps { style?: React.CSSProperties; className?: string; - color?: LiteralUnion; + color?: LiteralUnion; placement?: TooltipPlacement; builtinPlacements?: typeof Placements; openClassName?: string;