Skip to content

Commit

Permalink
chore: opt for warn perf (#972)
Browse files Browse the repository at this point in the history
* chore: opt for warn perf

* test: fix typo
  • Loading branch information
zombieJ authored Mar 17, 2023
1 parent ae3bc5b commit a9490ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,10 @@ function Table<RecordType extends DefaultRecordType>(tableProps: TableProps<Reco
if (typeof colWidth === 'number' && !Number.isNaN(colWidth)) {
return colWidth;
}
if (props.columns.length > 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.',
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Table.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

1 comment on commit a9490ca

@vercel
Copy link

@vercel vercel bot commented on a9490ca Mar 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

table – ./

table-react-component.vercel.app
table-git-master-react-component.vercel.app

Please sign in to comment.