@@ -157,31 +157,13 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
157
157
158
158
const mergedColumnWidth = useColumnWidth ( colWidths , columCount ) ;
159
159
160
- const colGroupNode = useMemo ( ( ) => {
160
+ const isColGroupEmpty = useMemo < boolean > ( ( ) => {
161
161
// use original ColGroup if no data or no calculated column width, otherwise use calculated column width
162
162
// Return original colGroup if no data, or mergedColumnWidth is empty, or all widths are falsy
163
- if (
164
- noData ||
165
- ! mergedColumnWidth ||
166
- mergedColumnWidth . length === 0 ||
167
- mergedColumnWidth . every ( width => ! width )
168
- ) {
169
- return ColGroup ;
170
- }
171
- return (
172
- < ColGroup
173
- colWidths = { [ ...mergedColumnWidth , combinationScrollBarSize ] }
174
- columCount = { columCount + 1 }
175
- columns = { flattenColumnsWithScrollbar }
176
- />
177
- ) ;
178
- } , [
179
- noData ,
180
- mergedColumnWidth ,
181
- combinationScrollBarSize ,
182
- columCount ,
183
- flattenColumnsWithScrollbar ,
184
- ] ) ;
163
+ const noWidth =
164
+ ! mergedColumnWidth || ! mergedColumnWidth . length || mergedColumnWidth . every ( w => ! w ) ;
165
+ return noData || noWidth ;
166
+ } , [ noData , mergedColumnWidth ] ) ;
185
167
186
168
return (
187
169
< div
@@ -203,7 +185,13 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
203
185
width : scrollX ,
204
186
} }
205
187
>
206
- { colGroupNode }
188
+ { isColGroupEmpty ? null : (
189
+ < ColGroup
190
+ colWidths = { [ ...mergedColumnWidth , combinationScrollBarSize ] }
191
+ columCount = { columCount + 1 }
192
+ columns = { flattenColumnsWithScrollbar }
193
+ />
194
+ ) }
207
195
{ children ( {
208
196
...restProps ,
209
197
stickyOffsets : headerStickyOffsets ,
0 commit comments