From 5ebb6d32f987ff56d6ebc0416a39d44ddd7c7ef5 Mon Sep 17 00:00:00 2001 From: vector Date: Wed, 24 Jan 2024 16:29:57 +0800 Subject: [PATCH] fix: add key for portal to avoid rerender (#4183) --- packages/x6-react-shape/src/view.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/x6-react-shape/src/view.ts b/packages/x6-react-shape/src/view.ts index 1b1dcdb507a..a0d82e2f486 100644 --- a/packages/x6-react-shape/src/view.ts +++ b/packages/x6-react-shape/src/view.ts @@ -32,7 +32,7 @@ export class ReactShapeView extends NodeView { if (container) { const elem = React.createElement(Wrap, { node, graph: this.graph }) if (Portal.isActive()) { - const portal = createPortal(elem, container) as ReactPortal + const portal = createPortal(elem, container, node.id) as ReactPortal Portal.connect(this.targetId(), portal) } else { this.root = createRoot(container)