diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 3d9b8b4ae8..2bc7b49f5c 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -809,13 +809,13 @@ export default class Table extends React.Component, TableState< [`${prefixCls}-column-sort`]: isSortColumn && sortOrder, }), title: [ -
+
{column.title} {sortButton}
, filterDropdown, ], - onHeaderCell: (columnProps: ColumnProps) => { + onHeaderCell: sortButton ? (columnProps: ColumnProps) => { // for onHeaderCell compatibility const headerCellProps = column.onHeaderCell ? column.onHeaderCell(columnProps) : {}; return { @@ -828,7 +828,7 @@ export default class Table extends React.Component, TableState< title: locale.sortTitle, ...headerCellProps, }; - }, + } : column.onHeaderCell, }; }); }