Skip to content

Commit a3385ba

Browse files
committed
chore(data-modeling): fix _diagram setter
1 parent 81a3156 commit a3385ba

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

packages/compass-data-modeling/src/components/diagram-editor.tsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,15 @@ const DiagramContent: React.FunctionComponent<{
109109
selectedItems,
110110
}) => {
111111
const isDarkMode = useDarkMode();
112-
const diagramContainerRef = useRef<HTMLDivElement | null>(null);
113112
const diagram = useRef(useDiagram());
114113
const { openDrawer } = useDrawerActions();
115114

116-
const setDiagramContainerRef = useCallback(
117-
(ref: HTMLDivElement | null) => {
118-
if (ref) {
119-
// For debugging purposes, we attach the diagram to the ref.
120-
(ref as any)._diagram = diagram;
121-
}
122-
diagramContainerRef.current = ref;
123-
},
124-
[diagram]
125-
);
115+
const setDiagramContainerRef = useCallback((ref: HTMLDivElement | null) => {
116+
if (ref) {
117+
// For debugging purposes, we attach the diagram to the ref.
118+
(ref as any)._diagram = diagram.current;
119+
}
120+
}, []);
126121

127122
const edges = useMemo<EdgeProps[]>(() => {
128123
return (model?.relationships ?? []).map((relationship) => {

0 commit comments

Comments
 (0)