fix(store): set domNode
This commit is contained in:
Generated
+1
-1
@@ -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",
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user