Merge pull request #373 from andys8/patch-3

Bugfix: Update onConnect
This commit is contained in:
Moritz
2020-07-28 09:28:43 +02:00
committed by GitHub

View File

@@ -142,10 +142,6 @@ const GraphView = memo(
updateDimensions();
window.onresize = updateDimensions;
if (onConnect) {
setOnConnect(onConnect);
}
if (rendererNode.current) {
resizeObserver = new ResizeObserver((entries) => {
for (let _ of entries) {
@@ -201,6 +197,12 @@ const GraphView = memo(
}
}, [d3Initialised, onLoad]);
useEffect(() => {
if (onConnect) {
setOnConnect(onConnect);
}
}, [onConnect]);
useEffect(() => {
setSnapGrid({ snapToGrid, snapGrid });
}, [snapToGrid]);