fix(store): set domNode
This commit is contained in:
2
example/package-lock.json
generated
2
example/package-lock.json
generated
@@ -27,7 +27,7 @@
|
||||
},
|
||||
"..": {
|
||||
"name": "react-flow-renderer",
|
||||
"version": "10.3.11",
|
||||
"version": "10.3.13",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.9",
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user