refactor(edgetext): render children closes #1073
This commit is contained in:
@@ -11,6 +11,7 @@ const EdgeText: FC<EdgeTextProps> = ({
|
|||||||
labelBgStyle = {},
|
labelBgStyle = {},
|
||||||
labelBgPadding = [2, 4],
|
labelBgPadding = [2, 4],
|
||||||
labelBgBorderRadius = 2,
|
labelBgBorderRadius = 2,
|
||||||
|
children,
|
||||||
...rest
|
...rest
|
||||||
}) => {
|
}) => {
|
||||||
const edgeRef = useRef<SVGTextElement>(null);
|
const edgeRef = useRef<SVGTextElement>(null);
|
||||||
@@ -50,6 +51,7 @@ const EdgeText: FC<EdgeTextProps> = ({
|
|||||||
<text className="react-flow__edge-text" y={edgeTextBbox.height / 2} dy="0.3em" ref={edgeRef} style={labelStyle}>
|
<text className="react-flow__edge-text" y={edgeTextBbox.height / 2} dy="0.3em" ref={edgeRef} style={labelStyle}>
|
||||||
{label}
|
{label}
|
||||||
</text>
|
</text>
|
||||||
|
{children}
|
||||||
</g>
|
</g>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user