Skip to content

Commit

Permalink
🐛 fix ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Oct 21, 2019
1 parent a387ef4 commit fae9681
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/TableCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface TableCellProps<ValueType> {
indent?: number;
indentSize?: number;
column?: ColumnType;
title?: string;
expandIcon?: React.ReactNode;
component?: CustomizeComponent;
}
Expand Down Expand Up @@ -56,7 +57,7 @@ export default class TableCell<ValueType> extends React.Component<TableCellProps
} else {
text = get(record, dataIndex);
}
let tdProps: Cell = {};
let tdProps: Cell & { title?: string } = {};
let colSpan: number;
let rowSpan: number;

Expand Down Expand Up @@ -108,13 +109,11 @@ export default class TableCell<ValueType> extends React.Component<TableCellProps
if (column.ellipsis) {
if (typeof text === 'string') {
tdProps.title = text;
} else if (
text &&
text.props &&
text.props.children &&
typeof text.props.children === 'string'
) {
tdProps.title = text.children;
} else if (text) {
const { props: textProps } = text as React.ReactElement<any>;
if (textProps && textProps.children && typeof textProps.children === 'string') {
tdProps.title = textProps.children;
}
}
}

Expand Down

0 comments on commit fae9681

Please sign in to comment.