diff --git a/package.json b/package.json index 1a8863191..c8fc8f38f 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,9 @@ "name": "rc-table", "version": "7.0.0-alpha.21", "description": "table ui component for react", + "engines": { + "node": "12.x" + }, "keywords": [ "react", "react-table", diff --git a/src/Cell/index.tsx b/src/Cell/index.tsx index b900600f6..889d91629 100644 --- a/src/Cell/index.tsx +++ b/src/Cell/index.tsx @@ -102,7 +102,11 @@ function Cell( } // Not crash if final `childNode` is not validate ReactNode - if (typeof childNode === 'object' && !React.isValidElement(childNode)) { + if ( + typeof childNode === 'object' && + !Array.isArray(childNode) && + !React.isValidElement(childNode) + ) { childNode = null; } diff --git a/tests/Table.spec.js b/tests/Table.spec.js index 68c2a6071..ed5b14ca3 100644 --- a/tests/Table.spec.js +++ b/tests/Table.spec.js @@ -719,4 +719,14 @@ describe('Table.Basic', () => { expect(internalRefs.body.current instanceof HTMLDivElement).toBeTruthy(); }); }); + + it('column render array', () => { + const wrapper = mount( + [] }]} + data={[{ key: 1 }]} + />, + ); + expect(wrapper.find('.test')).toHaveLength(1); + }); });