Merge pull request #5692 from xyflow/fix-exception-unmounting

Fix exception unmounting
This commit is contained in:
Moritz Klack
2026-01-27 11:26:16 +01:00
committed by GitHub
2 changed files with 15 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@xyflow/react': patch
---
Handle undefined node in mini map
@@ -84,13 +84,18 @@ function NodeComponentWrapperInner<NodeType extends Node>({
shapeRendering: string; shapeRendering: string;
}) { }) {
const { node, x, y, width, height } = useStore((s) => { const { node, x, y, width, height } = useStore((s) => {
const { internals } = s.nodeLookup.get(id)!; const node = s.nodeLookup.get(id);
const node = internals.userNode as NodeType;
const { x, y } = internals.positionAbsolute; if (!node) {
const { width, height } = getNodeDimensions(node); return { node: undefined, x: 0, y: 0, width: 0, height: 0 };
}
const userNode = node.internals.userNode as NodeType;
const { x, y } = node.internals.positionAbsolute;
const { width, height } = getNodeDimensions(userNode);
return { return {
node, node: userNode,
x, x,
y, y,
width, width,