fix(store): set domNode

This commit is contained in:
moklick
2022-08-05 19:19:41 +02:00
parent 46ba0dee9d
commit daf677dfb8
2 changed files with 2 additions and 4 deletions
+1 -1
View File
@@ -27,7 +27,7 @@
}, },
"..": { "..": {
"name": "react-flow-renderer", "name": "react-flow-renderer",
"version": "10.3.11", "version": "10.3.13",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.18.9", "@babel/runtime": "^7.18.9",
+1 -3
View File
@@ -59,7 +59,6 @@ const ZoomPane = ({
const store = useStoreApi(); const store = useStoreApi();
const isZoomingOrPanning = useRef(false); const isZoomingOrPanning = useRef(false);
const zoomPane = useRef<HTMLDivElement>(null); const zoomPane = useRef<HTMLDivElement>(null);
const initialized = useRef(false);
const prevTransform = useRef<Viewport>({ x: 0, y: 0, zoom: 0 }); const prevTransform = useRef<Viewport>({ x: 0, y: 0, zoom: 0 });
const { d3Zoom, d3Selection, d3ZoomHandler } = useStore(selector, shallow); const { d3Zoom, d3Selection, d3ZoomHandler } = useStore(selector, shallow);
const zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode); const zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode);
@@ -67,8 +66,7 @@ const ZoomPane = ({
useResizeHandler(zoomPane); useResizeHandler(zoomPane);
useEffect(() => { useEffect(() => {
if (zoomPane.current && !initialized.current) { if (zoomPane.current) {
initialized.current = true;
const d3ZoomInstance = zoom().scaleExtent([minZoom, maxZoom]).translateExtent(translateExtent); const d3ZoomInstance = zoom().scaleExtent([minZoom, maxZoom]).translateExtent(translateExtent);
const selection = select(zoomPane.current as Element).call(d3ZoomInstance); const selection = select(zoomPane.current as Element).call(d3ZoomInstance);