diff --git a/components/table/Table.tsx b/components/table/Table.tsx index addfdf719d..8559b95506 100644 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -419,7 +419,7 @@ function Table(props: TableProps) { data={pageData} rowKey={getRowKey} rowClassName={internalRowClassName} - emptyText={renderEmpty('Table')} + emptyText={(locale && locale.emptyText) || renderEmpty('Table')} // Internal internalHooks={INTERNAL_HOOKS} internalRefs={internalRefs as any} diff --git a/components/table/__tests__/__snapshots__/empty.test.js.snap b/components/table/__tests__/__snapshots__/empty.test.js.snap index 9eccc74df9..0162ad016e 100644 --- a/components/table/__tests__/__snapshots__/empty.test.js.snap +++ b/components/table/__tests__/__snapshots__/empty.test.js.snap @@ -230,52 +230,7 @@ exports[`Table renders empty table with custom emptyText 1`] = ` class="ant-table-cell" colspan="8" > -
-
- - - - - - - - - -
-

- No Data -

-
+ custom empty text diff --git a/components/table/__tests__/empty.test.js b/components/table/__tests__/empty.test.js index 7bd382cfe5..7ea6ccf2ad 100644 --- a/components/table/__tests__/empty.test.js +++ b/components/table/__tests__/empty.test.js @@ -61,7 +61,7 @@ describe('Table', () => { dataSource={[]} columns={columns} pagination={false} - locale={{ emptyText: 'custom empty text ' }} + locale={{ emptyText: 'custom empty text' }} />, ); expect(wrapper).toMatchSnapshot();