🐛 fix React.createElement undefined

This commit is contained in:
afc163 2019-09-28 14:37:07 +08:00 committed by 偏右
parent bbc8800cb8
commit 650d44e8a7
2 changed files with 5 additions and 5 deletions

View File

@ -137,10 +137,6 @@ function isFiltersChanged<T>(state: TableState<T>, filters: TableStateFilters):
}
class Table<T> extends React.Component<TableProps<T>, TableState<T>> {
static Column = Column;
static ColumnGroup = ColumnGroup;
static propTypes = {
dataSource: PropTypes.array,
columns: PropTypes.array,
@ -1369,6 +1365,10 @@ function withStore(
WrappedComponent: typeof Table,
): React.ComponentClass<Omit<TableProps<any>, keyof WithStore>> {
class Component<T> extends React.Component<TableProps<T>> {
static Column = Column;
static ColumnGroup = ColumnGroup;
store: Store;
CheckboxPropsCache: CheckboxPropsCache;

View File

@ -63,7 +63,7 @@ export function normalizeColumns(elements: React.ReactChildren) {
if (element.key) {
column.key = element.key;
}
if (element.props && (element.props as any).children) {
if (element.type && (element.type as any).__ANT_TABLE_COLUMN_GROUP) {
column.children = normalizeColumns(column.children);
}
columns.push(column);