diff --git a/src/Table.tsx b/src/Table.tsx index 41d2cd877..2be5e02a3 100644 --- a/src/Table.tsx +++ b/src/Table.tsx @@ -570,9 +570,10 @@ function Table(tableProps: TableProps 0) { + + if (process.env.NODE_ENV !== 'production') { warning( - false, + props.columns.length === 0, 'When use `components.body` with render props. Each column should have a fixed `width` value.', ); } diff --git a/tests/Table.spec.js b/tests/Table.spec.js index 8e4fec37d..f7ec77a15 100644 --- a/tests/Table.spec.js +++ b/tests/Table.spec.js @@ -701,7 +701,7 @@ describe('Table.Basic', () => { }); }); - it('without warning - columns is emplty', () => { + it('without warning - columns is empty', () => { resetWarned(); const errSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); mount(