Skip to content

Commit

Permalink
fix(store): set domNode
Browse files Browse the repository at this point in the history
  • Loading branch information
moklick committed Aug 5, 2022
1 parent 46ba0de commit daf677d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/container/ZoomPane/index.tsx
Expand Up @@ -59,16 +59,14 @@ 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);

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);

Expand Down

0 comments on commit daf677d

Please sign in to comment.