@@ -90,20 +90,19 @@ export interface HeaderProps<RecordType> {
9090 onHeaderRow : GetComponentProps < readonly ColumnType < RecordType > [ ] > ;
9191}
9292
93- function Header < RecordType > ( props : HeaderProps < RecordType > ) : React . ReactElement {
93+ const Header = < RecordType extends any > ( props : HeaderProps < RecordType > ) => {
9494 if ( process . env . NODE_ENV !== 'production' ) {
9595 devRenderTimes ( props ) ;
9696 }
9797
9898 const { stickyOffsets, columns, flattenColumns, onHeaderRow } = props ;
9999
100100 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 ] ) ;
102102
103103 const WrapperComponent = getComponent ( [ 'header' , 'wrapper' ] , 'thead' ) ;
104104 const trComponent = getComponent ( [ 'header' , 'row' ] , 'tr' ) ;
105105 const thComponent = getComponent ( [ 'header' , 'cell' ] , 'th' ) ;
106- const tdComponent = getComponent ( [ 'header' , 'cell' ] , 'td' ) ;
107106
108107 return (
109108 < WrapperComponent className = { `${ prefixCls } -thead` } >
@@ -116,16 +115,14 @@ function Header<RecordType>(props: HeaderProps<RecordType>): React.ReactElement
116115 stickyOffsets = { stickyOffsets }
117116 rowComponent = { trComponent }
118117 cellComponent = { thComponent }
119- tdCellComponent = { tdComponent }
120118 onHeaderRow = { onHeaderRow }
121119 index = { rowIndex }
122120 />
123121 ) ;
124-
125122 return rowNode ;
126123 } ) }
127124 </ WrapperComponent >
128125 ) ;
129- }
126+ } ;
130127
131128export default responseImmutable ( Header ) ;
0 commit comments