From f3244d6ae06b1ec23b3158b1d39d9410771a4a42 Mon Sep 17 00:00:00 2001 From: paranoidjk Date: Tue, 27 Aug 2019 16:44:53 +0800 Subject: [PATCH] fix(Table): apply props.style to container div (#18494) * fix(Table): apply props.style to container div * fix: ci --- .../empty/__tests__/__snapshots__/demo.test.js.snap | 2 +- components/table/Table.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/empty/__tests__/__snapshots__/demo.test.js.snap b/components/empty/__tests__/__snapshots__/demo.test.js.snap index 6978d0d288..b46145fa00 100644 --- a/components/empty/__tests__/__snapshots__/demo.test.js.snap +++ b/components/empty/__tests__/__snapshots__/demo.test.js.snap @@ -466,6 +466,7 @@ exports[`renders ./components/empty/demo/config-provider.md correctly 1`] = `
extends React.Component, TableState< contextLocale: TableLocale; getPopupContainer: TableProps['getPopupContainer']; }) => { - const { showHeader, locale, getPopupContainer, ...restProps } = this.props; + const { showHeader, locale, getPopupContainer, ...restTableProps } = this.props; + // do not pass prop.style to rc-table, since already apply it to container div + const restProps = omit(restTableProps, ['style']); const data = this.getCurrentPageData(); const expandIconAsCell = this.props.expandedRowRender && this.props.expandIconAsCell !== false; @@ -1279,6 +1282,7 @@ export default class Table extends React.Component, TableState< const { prefixCls: customizePrefixCls, dropdownPrefixCls: customizeDropdownPrefixCls, + style, className, } = this.props; const data = this.getCurrentPageData(); @@ -1314,7 +1318,7 @@ export default class Table extends React.Component, TableState< : `${prefixCls}-without-pagination`; return ( -
+