File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 22 "name" : " rc-table" ,
33 "version" : " 7.0.0-alpha.21" ,
44 "description" : " table ui component for react" ,
5+ "engines" : {
6+ "node" : " 12.x"
7+ },
58 "keywords" : [
69 " react" ,
710 " react-table" ,
Original file line number Diff line number Diff line change @@ -102,7 +102,11 @@ function Cell<RecordType extends DefaultRecordType>(
102102 }
103103
104104 // Not crash if final `childNode` is not validate ReactNode
105- if ( typeof childNode === 'object' && ! React . isValidElement ( childNode ) ) {
105+ if (
106+ typeof childNode === 'object' &&
107+ ! Array . isArray ( childNode ) &&
108+ ! React . isValidElement ( childNode )
109+ ) {
106110 childNode = null ;
107111 }
108112
Original file line number Diff line number Diff line change @@ -719,4 +719,14 @@ describe('Table.Basic', () => {
719719 expect ( internalRefs . body . current instanceof HTMLDivElement ) . toBeTruthy ( ) ;
720720 } ) ;
721721 } ) ;
722+
723+ it ( 'column render array' , ( ) => {
724+ const wrapper = mount (
725+ < Table
726+ columns = { [ { dataIndex : 'test' , render : ( ) => [ < span className = "test" key = "test" /> ] } ] }
727+ data = { [ { key : 1 } ] }
728+ /> ,
729+ ) ;
730+ expect ( wrapper . find ( '.test' ) ) . toHaveLength ( 1 ) ;
731+ } ) ;
722732} ) ;
You can’t perform that action at this time.
0 commit comments