Skip to content

Commit 7db6422

Browse files
committed
#4009 remove redundant code
1 parent 3265a1a commit 7db6422

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

src/frontend/src/pages/GanttPage/GanttChart/GanttChartCollectionSection.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ interface GanttChartCollectionSectionProps<E, T> {
1010
endDate: Date;
1111
collection: GanttCollection<E, T>;
1212
editability?: GanttEditability<E, T>;
13-
onHeightChange?: (height: number) => void;
1413
}
1514

1615
const GanttChartCollectionSection = <E, T>({
1716
startDate,
1817
endDate,
1918
collection,
20-
editability,
21-
onHeightChange
19+
editability
2220
}: GanttChartCollectionSectionProps<E, T>) => {
2321
const theme = useTheme();
2422
const [isEditMode, setIsEditMode] = useState(false);
@@ -64,18 +62,6 @@ const GanttChartCollectionSection = <E, T>({
6462

6563
const ignoreBool = () => false;
6664

67-
useEffect(() => {
68-
const el = sectionRef.current;
69-
if (!el || !onHeightChange) return;
70-
71-
const ro = new ResizeObserver(() => {
72-
onHeightChange(el.getBoundingClientRect().height);
73-
});
74-
ro.observe(el);
75-
onHeightChange(el.getBoundingClientRect().height);
76-
return () => ro.disconnect();
77-
}, [onHeightChange]);
78-
7965
return (
8066
<Box ref={sectionRef} sx={collectionSectionBackgroundStyle}>
8167
<Box sx={collectionDescriptionContainerStyle}>

0 commit comments

Comments
 (0)