refactor(inrernals): use one prop for all internals

This commit is contained in:
moklick
2022-05-26 20:20:35 +02:00
parent 732d92d10b
commit ee7084b5dc
9 changed files with 35 additions and 30 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import { getBezierPath } from '../Edges/BezierEdge';
import { getSmoothStepPath } from '../Edges/SmoothStepEdge';
import { ConnectionLineType, ConnectionLineComponent, HandleType, Node, ReactFlowState, Position } from '../../types';
import { getSimpleBezierPath } from '../Edges/SimpleBezierEdge';
import { handleBoundsSymbol } from '../../utils';
import { internalsSymbol } from '../../utils';
interface ConnectionLineProps {
connectionNodeId: string;
@@ -38,7 +38,7 @@ export default ({
const { nodeInternals, transform } = useStore(selector, shallow);
const fromNode = useRef<Node | undefined>(nodeInternals.get(nodeId));
const fromHandleBounds = fromNode.current?.[handleBoundsSymbol];
const fromHandleBounds = fromNode.current?.[internalsSymbol].handleBounds;
if (!fromNode.current || !isConnectable || !fromHandleBounds?.[connectionHandleType]) {
return null;