fix typescript error

This commit is contained in:
Eduard Heimbuch
2019-12-02 14:10:04 +01:00
parent 75468483cf
commit ef74a54b91

View File

@@ -66,6 +66,7 @@ const Table: FC<Props> = ({ data, sortable, children }) => {
};
// @ts-ignore
const { header } = child.props;
return (
tableData.length > 0 && (
<StyledTable>
@@ -78,8 +79,9 @@ const Table: FC<Props> = ({ data, sortable, children }) => {
onMouseEnter={() => setHoveredColumnIndex(index)}
onMouseLeave={() => setHoveredColumnIndex(undefined)}
>
{child.props.header}
{isSortable(child) && renderSortIcon(child, ascending, index === lastSortBy || index === hoveredColumnIndex)}
{header}
{isSortable(child) &&
renderSortIcon(child, ascending, index === lastSortBy || index === hoveredColumnIndex)}
</th>
))}
</tr>