@@ -90,20 +90,19 @@ export interface HeaderProps<RecordType> {
90
90
onHeaderRow : GetComponentProps < readonly ColumnType < RecordType > [ ] > ;
91
91
}
92
92
93
- function Header < RecordType > ( props : HeaderProps < RecordType > ) : React . ReactElement {
93
+ const Header = < RecordType extends any > ( props : HeaderProps < RecordType > ) => {
94
94
if ( process . env . NODE_ENV !== 'production' ) {
95
95
devRenderTimes ( props ) ;
96
96
}
97
97
98
98
const { stickyOffsets, columns, flattenColumns, onHeaderRow } = props ;
99
99
100
100
const { prefixCls, getComponent } = useContext ( TableContext , [ 'prefixCls' , 'getComponent' ] ) ;
101
- const rows : CellType < RecordType > [ ] [ ] = React . useMemo ( ( ) => parseHeaderRows ( columns ) , [ columns ] ) ;
101
+ const rows = React . useMemo < CellType < RecordType > [ ] [ ] > ( ( ) => parseHeaderRows ( columns ) , [ columns ] ) ;
102
102
103
103
const WrapperComponent = getComponent ( [ 'header' , 'wrapper' ] , 'thead' ) ;
104
104
const trComponent = getComponent ( [ 'header' , 'row' ] , 'tr' ) ;
105
105
const thComponent = getComponent ( [ 'header' , 'cell' ] , 'th' ) ;
106
- const tdComponent = getComponent ( [ 'header' , 'cell' ] , 'td' ) ;
107
106
108
107
return (
109
108
< WrapperComponent className = { `${ prefixCls } -thead` } >
@@ -116,16 +115,14 @@ function Header<RecordType>(props: HeaderProps<RecordType>): React.ReactElement
116
115
stickyOffsets = { stickyOffsets }
117
116
rowComponent = { trComponent }
118
117
cellComponent = { thComponent }
119
- tdCellComponent = { tdComponent }
120
118
onHeaderRow = { onHeaderRow }
121
119
index = { rowIndex }
122
120
/>
123
121
) ;
124
-
125
122
return rowNode ;
126
123
} ) }
127
124
</ WrapperComponent >
128
125
) ;
129
- }
126
+ } ;
130
127
131
128
export default responseImmutable ( Header ) ;
0 commit comments