Browse Source

fix: Update List ts definition (#16594)

pull/16597/head
zombieJ 6 years ago
committed by GitHub
parent
commit
c598b364dd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      components/list/index.tsx

8
components/list/index.tsx

@ -36,7 +36,7 @@ export interface ListProps<T> {
className?: string;
style?: React.CSSProperties;
children?: React.ReactNode;
dataSource: T[];
dataSource?: T[];
extra?: React.ReactNode;
grid?: ListGridType;
id?: string;
@ -46,7 +46,7 @@ export interface ListProps<T> {
pagination?: PaginationConfig | false;
prefixCls?: string;
rowKey?: any;
renderItem: (item: T, index: number) => React.ReactNode;
renderItem?: (item: T, index: number) => React.ReactNode;
size?: ListSize;
split?: boolean;
header?: React.ReactNode;
@ -124,6 +124,8 @@ export default class List<T> extends React.Component<ListProps<T>, ListState> {
renderItem = (item: any, index: number) => {
const { renderItem, rowKey } = this.props;
if (!renderItem) return null;
let key;
if (typeof rowKey === 'function') {
@ -170,7 +172,7 @@ export default class List<T> extends React.Component<ListProps<T>, ListState> {
loadMore,
pagination,
grid,
dataSource,
dataSource = [],
size,
rowKey,
renderItem,

Loading…
Cancel
Save