refactor: use existing d3Selection to get the element ref

This commit is contained in:
GeoffreyLiu
2022-11-14 08:30:09 +08:00
parent 1993734a99
commit 23aa8bb270
9 changed files with 15 additions and 92 deletions
@@ -6,7 +6,6 @@ import EdgeRenderer from '../EdgeRenderer';
import ViewportWrapper from '../Viewport';
import useOnInitHandler from '../../hooks/useOnInitHandler';
import type { EdgeTypesWrapped, NodeTypesWrapped, ReactFlowProps } from '../../types';
import { EDGE_LABEL_RENDERER_MAIN_CLASS } from '../../constants/component';
export type GraphViewProps = Omit<ReactFlowProps, 'onSelectionChange' | 'nodes' | 'edges' | 'nodeTypes' | 'edgeTypes'> &
Required<
@@ -159,7 +158,7 @@ const GraphView = ({
disableKeyboardA11y={disableKeyboardA11y}
rfId={rfId}
/>
<div className={EDGE_LABEL_RENDERER_MAIN_CLASS} />
<div className="react-flow__edgelabel-renderer" />
<NodeRenderer
nodeTypes={nodeTypes}