@@ -157,31 +157,13 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
157157
158158 const mergedColumnWidth = useColumnWidth ( colWidths , columCount ) ;
159159
160- const colGroupNode = useMemo ( ( ) => {
160+ const isColGroupEmpty = useMemo < boolean > ( ( ) => {
161161 // use original ColGroup if no data or no calculated column width, otherwise use calculated column width
162162 // 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 ] ) ;
185167
186168 return (
187169 < div
@@ -203,7 +185,13 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
203185 width : scrollX ,
204186 } }
205187 >
206- { colGroupNode }
188+ { isColGroupEmpty ? null : (
189+ < ColGroup
190+ colWidths = { [ ...mergedColumnWidth , combinationScrollBarSize ] }
191+ columCount = { columCount + 1 }
192+ columns = { flattenColumnsWithScrollbar }
193+ />
194+ ) }
207195 { children ( {
208196 ...restProps ,
209197 stickyOffsets : headerStickyOffsets ,
0 commit comments