Skip to content

Commit c30f805

Browse files
committed
avoiding closure problems
1 parent a6ca532 commit c30f805

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/FixedHolder/index.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
156156

157157
const mergedColumnWidth = useColumnWidth(colWidths, columCount);
158158

159-
const colGroupNode = useMemo(() => {
159+
const renderColGroup = () => {
160160
// use original ColGroup if no data or no calculated column width, otherwise use calculated column width
161161
// Return original colGroup if no data, or mergedColumnWidth is empty, or all widths are falsy
162162
if (
@@ -174,13 +174,7 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
174174
columns={flattenColumnsWithScrollbar}
175175
/>
176176
);
177-
}, [
178-
noData,
179-
mergedColumnWidth,
180-
combinationScrollBarSize,
181-
columCount,
182-
flattenColumnsWithScrollbar,
183-
]);
177+
};
184178

185179
return (
186180
<div
@@ -202,7 +196,7 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
202196
width: scrollX,
203197
}}
204198
>
205-
{colGroupNode}
199+
{renderColGroup()}
206200
{children({
207201
...restProps,
208202
stickyOffsets: headerStickyOffsets,

0 commit comments

Comments
 (0)