@@ -453,12 +453,10 @@ export default React.createClass({
453
453
} }
454
454
{ ...rest }
455
455
>
456
- { typeof column . header === 'function' ? (
457
- < column . header
458
- data = { sortedData }
459
- column = { column }
460
- />
461
- ) : column . header }
456
+ { _ . normalizeComponent ( column . header , {
457
+ data : sortedData ,
458
+ column : column
459
+ } ) }
462
460
</ ThComponent >
463
461
)
464
462
}
@@ -537,12 +535,10 @@ export default React.createClass({
537
535
{ column . pivotColumns . map ( ( pivotColumn , i ) => {
538
536
return (
539
537
< span key = { pivotColumn . id } >
540
- { typeof pivotColumn . header === 'function' ? (
541
- < pivotColumn . header
542
- data = { sortedData }
543
- column = { pivotColumn }
544
- />
545
- ) : pivotColumn . header }
538
+ { _ . normalizeComponent ( pivotColumn . header , {
539
+ data : sortedData ,
540
+ column : column
541
+ } ) }
546
542
{ i < column . pivotColumns . length - 1 && (
547
543
< ExpanderComponent />
548
544
) }
@@ -589,12 +585,10 @@ export default React.createClass({
589
585
} }
590
586
{ ...rest }
591
587
>
592
- { typeof column . header === 'function' ? (
593
- < column . header
594
- data = { sortedData }
595
- column = { column }
596
- />
597
- ) : column . header }
588
+ { _ . normalizeComponent ( column . header , {
589
+ data : sortedData ,
590
+ column : column
591
+ } ) }
598
592
</ ThComponent >
599
593
)
600
594
}
@@ -627,7 +621,6 @@ export default React.createClass({
627
621
{ ...trProps . rest }
628
622
>
629
623
{ allVisibleColumns . map ( ( column , i2 ) => {
630
- const Cell = column . render
631
624
const show = typeof column . show === 'function' ? column . show ( ) : column . show
632
625
const width = _ . getFirstDefined ( column . width , column . minWidth )
633
626
const maxWidth = _ . getFirstDefined ( column . width , column . maxWidth )
@@ -745,17 +738,10 @@ export default React.createClass({
745
738
} }
746
739
{ ...tdProps . rest }
747
740
>
748
- { typeof Cell === 'function' ? (
749
- Cell . prototype . isReactComponent ? (
750
- < Cell
751
- { ...rowInfo }
752
- value = { rowInfo . rowValues [ column . id ] }
753
- />
754
- ) : Cell ( {
755
- ...rowInfo ,
756
- value : rowInfo . rowValues [ column . id ]
757
- } )
758
- ) : rowInfo . rowValues [ column . id ] }
741
+ { _ . normalizeComponent ( column . render , {
742
+ ...rowInfo ,
743
+ value : rowInfo . rowValues [ column . id ]
744
+ } , rowInfo . rowValues [ column . id ] ) }
759
745
</ TdComponent >
760
746
)
761
747
} ) }
0 commit comments