refactor(internals): make prop optional

This commit is contained in:
moklick
2022-05-26 20:57:12 +02:00
parent ee7084b5dc
commit 2ed3ffe818
8 changed files with 30 additions and 14 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ export default ({
const { nodeInternals, transform } = useStore(selector, shallow);
const fromNode = useRef<Node | undefined>(nodeInternals.get(nodeId));
const fromHandleBounds = fromNode.current?.[internalsSymbol].handleBounds;
const fromHandleBounds = fromNode.current?.[internalsSymbol]?.handleBounds;
if (!fromNode.current || !isConnectable || !fromHandleBounds?.[connectionHandleType]) {
return null;