From daf677dfb88ef96eca71beedb7f70eac267e6acd Mon Sep 17 00:00:00 2001 From: moklick Date: Fri, 5 Aug 2022 19:19:41 +0200 Subject: [PATCH] fix(store): set domNode --- example/package-lock.json | 2 +- src/container/ZoomPane/index.tsx | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/example/package-lock.json b/example/package-lock.json index c4ed3488..d96748fc 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -27,7 +27,7 @@ }, "..": { "name": "react-flow-renderer", - "version": "10.3.11", + "version": "10.3.13", "license": "MIT", "dependencies": { "@babel/runtime": "^7.18.9", diff --git a/src/container/ZoomPane/index.tsx b/src/container/ZoomPane/index.tsx index fd309741..6d1fc017 100644 --- a/src/container/ZoomPane/index.tsx +++ b/src/container/ZoomPane/index.tsx @@ -59,7 +59,6 @@ const ZoomPane = ({ const store = useStoreApi(); const isZoomingOrPanning = useRef(false); const zoomPane = useRef(null); - const initialized = useRef(false); const prevTransform = useRef({ x: 0, y: 0, zoom: 0 }); const { d3Zoom, d3Selection, d3ZoomHandler } = useStore(selector, shallow); const zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode); @@ -67,8 +66,7 @@ const ZoomPane = ({ useResizeHandler(zoomPane); useEffect(() => { - if (zoomPane.current && !initialized.current) { - initialized.current = true; + if (zoomPane.current) { const d3ZoomInstance = zoom().scaleExtent([minZoom, maxZoom]).translateExtent(translateExtent); const selection = select(zoomPane.current as Element).call(d3ZoomInstance);