From bf5b6ae1f3b5da4629a7d10a2d1764eaa3fbbb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Szabo?= Date: Wed, 27 Jun 2018 11:39:31 +0200 Subject: [PATCH] Fix incompatible type error for Table[size] prop --- components/table/Table.tsx | 3 ++- components/table/interface.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/table/Table.tsx b/components/table/Table.tsx index f0367a3524..9d8e061c55 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -20,6 +20,7 @@ import { flatArray, treeMap, flatFilter, normalizeColumns } from './util'; import { SpinProps } from '../spin'; import { TableProps, + TableSize, TableState, TableComponents, RowSelectionType, @@ -88,7 +89,7 @@ export default class Table extends React.Component, TableState< prefixCls: 'ant-table', useFixedHeader: false, className: '', - size: 'large', + size: 'default' as TableSize, loading: false, bordered: false, indentSize: 20, diff --git a/components/table/interface.tsx b/components/table/interface.tsx index e1c121937c..ba4aa3fccb 100644 --- a/components/table/interface.tsx +++ b/components/table/interface.tsx @@ -84,12 +84,13 @@ export interface SorterResult { field: string; columnKey: string; } +export type TableSize = 'default' | 'middle' | 'small'; export interface TableProps { prefixCls?: string; dropdownPrefixCls?: string; rowSelection?: TableRowSelection; pagination?: PaginationConfig | false; - size?: 'default' | 'middle' | 'small'; + size?: TableSize; dataSource?: T[]; components?: TableComponents; columns?: ColumnProps[];