From 1879ba1e4e14d3bfe16a9bc4eb847f4c5c8dbb89 Mon Sep 17 00:00:00 2001 From: moklick Date: Wed, 23 Oct 2019 17:12:02 +0200 Subject: [PATCH] refactor(edgerenderer): dont draw edge when node has no height or width --- src/container/EdgeRenderer/index.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/container/EdgeRenderer/index.tsx b/src/container/EdgeRenderer/index.tsx index 820546f2..9a97bb3a 100644 --- a/src/container/EdgeRenderer/index.tsx +++ b/src/container/EdgeRenderer/index.tsx @@ -127,6 +127,11 @@ function renderEdge(edge: Edge, props: EdgeRendererProps, nodes: Node[], selecte if (!targetNode) { throw new Error(`couldn't create edge for target id: ${targetId}`); } + + if (!sourceNode.__rg.width || !sourceNode.__rg.height) { + return null; + } + const edgeType = edge.type || 'default'; const EdgeComponent = props.edgeTypes[edgeType] || props.edgeTypes.default; const sourceHandle = getHandle(sourceNode.__rg.handleBounds.source, sourceHandleId);