feat(wrapper): add onSelectionChange handler

This commit is contained in:
moklick
2020-05-25 14:00:46 +02:00
parent 3d80fb6586
commit f154f59e74
9 changed files with 62 additions and 43 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ function renderNode(
node: Node,
props: NodeRendererProps,
transform: Transform,
selectedElements: Elements,
selectedElements: Elements | null,
isInteractive: boolean
) {
const nodeType = node.type || 'default';
@@ -25,7 +25,7 @@ function renderNode(
console.warn(`No node type found for type "${nodeType}". Using fallback type "default".`);
}
const isSelected = selectedElements.some(({ id }) => id === node.id);
const isSelected = selectedElements ? selectedElements.some(({ id }) => id === node.id) : false;
return (
<NodeComponent