diff --git a/package-lock.json b/package-lock.json index 99b05dc0..5a947e29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-flow-renderer", - "version": "4.4.0", + "version": "4.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0c2c432e..aa0e5817 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-flow-renderer", - "version": "4.4.0", + "version": "4.7.0", "main": "dist/ReactFlow.js", "module": "dist/ReactFlow.esm.js", "types": "dist/index.d.ts", diff --git a/src/container/GraphView/index.tsx b/src/container/GraphView/index.tsx index f58985c0..987ea8bf 100644 --- a/src/container/GraphView/index.tsx +++ b/src/container/GraphView/index.tsx @@ -141,9 +141,6 @@ const GraphView = ({ updateDimensions(); window.onresize = updateDimensions; - if (onConnect) { - setOnConnect(onConnect); - } if (rendererNode.current) { resizeObserver = new ResizeObserver((entries) => { @@ -199,6 +196,12 @@ const GraphView = ({ } } }, [d3Initialised, onLoad]); + + useEffect(() => { + if (onConnect) { + setOnConnect(onConnect); + } + }, [onConnect]); useEffect(() => { setSnapGrid({ snapToGrid, snapGrid });