Browse Source

fix: titles of TransferProps type to ReactNode (#28326)

pull/28326/merge
Jack 4 years ago
committed by GitHub
parent
commit
e6254885bd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      components/transfer/index.tsx
  2. 2
      components/transfer/list.tsx

6
components/transfer/index.tsx

@ -46,7 +46,7 @@ export type SelectAllLabel =
| ((info: { selectedCount: number; totalCount: number }) => React.ReactNode);
export interface TransferLocale {
titles: string[];
titles: React.ReactNode[];
notFoundContent?: React.ReactNode;
searchPlaceholder: string;
itemUnit: string;
@ -72,7 +72,7 @@ export interface TransferProps<RecordType> {
style?: React.CSSProperties;
listStyle: ((style: ListStyle) => React.CSSProperties) | React.CSSProperties;
operationStyle?: React.CSSProperties;
titles?: string[];
titles?: React.ReactNode[];
operations?: string[];
showSearch?: boolean;
filterOption?: (inputValue: string, item: RecordType) => boolean;
@ -164,7 +164,7 @@ class Transfer<RecordType extends TransferItem = TransferItem> extends React.Com
}
};
getTitles(transferLocale: TransferLocale): string[] {
getTitles(transferLocale: TransferLocale): React.ReactNode[] {
const { titles } = this.props;
if (titles) {
return titles;

2
components/transfer/list.tsx

@ -42,7 +42,7 @@ type RenderListFunction<T> = (props: TransferListBodyProps<T>) => React.ReactNod
export interface TransferListProps<RecordType> extends TransferLocale {
prefixCls: string;
titleText: string;
titleText: React.ReactNode;
dataSource: RecordType[];
filterOption?: (filterText: string, item: RecordType) => boolean;
style?: React.CSSProperties;

Loading…
Cancel
Save