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

View File

@@ -27,7 +27,7 @@
},
"..": {
"name": "react-flow-renderer",
"version": "10.3.11",
"version": "10.3.13",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.18.9",

View File

@@ -59,7 +59,6 @@ const ZoomPane = ({
const store = useStoreApi();
const isZoomingOrPanning = useRef(false);
const zoomPane = useRef<HTMLDivElement>(null);
const initialized = useRef(false);
const prevTransform = useRef<Viewport>({ 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);