@@ -74,14 +74,6 @@ class GridTable extends React.PureComponent {
74
74
return rowRenderer ( { ...args , columns, rowData } ) ;
75
75
}
76
76
77
- getColumnWidthFunction ( columnWidths ) {
78
- return ( index ) => columnWidths [ index ] ;
79
- }
80
-
81
- getColumnCount ( ) {
82
- return this . props . columnWidths && Array . isArray ( this . props . columnWidths ) ? this . props . columnWidths . length : 1
83
- }
84
-
85
77
render ( ) {
86
78
const {
87
79
containerStyle,
@@ -100,20 +92,17 @@ class GridTable extends React.PureComponent {
100
92
onScroll,
101
93
hoveredRowKey,
102
94
overscanRowCount,
103
- overscanColumnCount,
104
95
// omit from rest
105
96
style,
106
97
onScrollbarPresenceChange,
107
- columnWidths,
108
98
...rest
109
99
} = this . props ;
110
100
const headerHeight = this . _getHeaderHeight ( ) ;
111
101
const frozenRowCount = frozenData . length ;
112
102
const frozenRowsHeight = rowHeight * frozenRowCount ;
113
103
const cls = cn ( `${ classPrefix } __table` , className ) ;
114
104
const containerProps = containerStyle ? { style : containerStyle } : null ;
115
- const Grid = ( estimatedRowHeight || columnWidths ) ? VariableSizeGrid : FixedSizeGrid ;
116
- const columnCount = this . getColumnCount ( ) ;
105
+ const Grid = estimatedRowHeight ? VariableSizeGrid : FixedSizeGrid ;
117
106
118
107
this . _resetColumnWidthCache ( bodyWidth ) ;
119
108
return (
@@ -128,13 +117,13 @@ class GridTable extends React.PureComponent {
128
117
frozenData = { frozenData }
129
118
width = { width }
130
119
height = { Math . max ( height - headerHeight - frozenRowsHeight , 0 ) }
131
- rowHeight = { ( estimatedRowHeight || columnWidths ) ? ( getRowHeight ? getRowHeight : ( ) => rowHeight ) : rowHeight }
120
+ rowHeight = { estimatedRowHeight ? getRowHeight : rowHeight }
132
121
estimatedRowHeight = { typeof estimatedRowHeight === 'function' ? undefined : estimatedRowHeight }
133
122
rowCount = { data . length }
134
123
overscanRowCount = { overscanRowCount }
135
- columnWidth = { columnWidths ? this . getColumnWidthFunction ( columnWidths ) : estimatedRowHeight ? this . _getBodyWidth : bodyWidth }
136
- columnCount = { columnCount }
137
- overscanColumnCount = { overscanColumnCount }
124
+ columnWidth = { estimatedRowHeight ? this . _getBodyWidth : bodyWidth }
125
+ columnCount = { 1 }
126
+ overscanColumnCount = { 0 }
138
127
useIsScrolling = { useIsScrolling }
139
128
hoveredRowKey = { hoveredRowKey }
140
129
onScroll = { onScroll }
@@ -221,15 +210,13 @@ GridTable.propTypes = {
221
210
rowKey : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) . isRequired ,
222
211
useIsScrolling : PropTypes . bool ,
223
212
overscanRowCount : PropTypes . number ,
224
- overscanColumnCount : PropTypes . number ,
225
213
hoveredRowKey : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
226
214
style : PropTypes . object ,
227
215
onScrollbarPresenceChange : PropTypes . func ,
228
216
onScroll : PropTypes . func ,
229
217
onRowsRendered : PropTypes . func ,
230
218
headerRenderer : PropTypes . func . isRequired ,
231
219
rowRenderer : PropTypes . func . isRequired ,
232
- columnWidths : PropTypes . arrayOf ( PropTypes . number ) ,
233
220
} ;
234
221
235
222
export default GridTable ;
0 commit comments