refactor(general): cleanup

This commit is contained in:
moklick
2021-12-09 09:17:36 +01:00
parent 38308781ee
commit 81585dbff5
17 changed files with 70 additions and 137 deletions
+6 -3
View File
@@ -1,11 +1,12 @@
/**
* The nodes selection rectangle gets displayed when a user
* made a selectio with on or several nodes
* made a selection with on or several nodes
*/
import React, { memo, useMemo, useCallback, useRef, MouseEvent } from 'react';
import { DraggableCore, DraggableData } from 'react-draggable';
import cc from 'classcat';
import shallow from 'zustand/shallow';
import { useStore } from '../../store';
import { Node, ReactFlowState } from '../../types';
@@ -38,8 +39,10 @@ function NodesSelection({
onSelectionContextMenu,
noPanClassName,
}: NodesSelectionProps) {
const { transform, userSelectionActive, selectedNodes, snapToGrid, snapGrid, updateNodePosition } =
useStore(selector);
const { transform, userSelectionActive, selectedNodes, snapToGrid, snapGrid, updateNodePosition } = useStore(
selector,
shallow
);
const [tX, tY, tScale] = transform;
const nodeRef = useRef(null);