Skip to content

Commit 66fad9b

Browse files
committed
fix: 🐛 avoide React use "key" warnings
1 parent c9d767a commit 66fad9b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/ListTable/__story__/story.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,13 @@ storiesOf('UI/ListTable', module)
103103
<div>6</div>
104104
</ListTable>
105105
)
106+
.add('Cells as text', () =>
107+
<ListTable cols={2}>
108+
{'1'}
109+
{'2'}
110+
{'3'}
111+
{'4'}
112+
{'5'}
113+
{'6'}
114+
</ListTable>
115+
)

src/ListTable/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22

33
const h = React.createElement;
44

5-
const defaultRenderRow = cells => h('tr', null, cells);
5+
const defaultRenderRow = cells => h('tr', null, ...cells);
66

77
export interface Props {
88
cols?: number;
@@ -26,7 +26,7 @@ export const ListTable: React.SFC<Props> = ({cols, renderRow, children}) => {
2626
}
2727

2828
return h('table', null, h('tbody', null,
29-
rows,
29+
...rows,
3030
));
3131
};
3232

0 commit comments

Comments
 (0)