refactor(elements): simplfy node and edge handling
This commit is contained in:
@@ -66,7 +66,7 @@ const onNodeClick = (evt, { onClick, dispatch, id, type, position, data }) => {
|
||||
|
||||
const node = { id, type, position, data }
|
||||
|
||||
dispatch(setSelectedElements(node));
|
||||
dispatch(setSelectedElements({ id, type }));
|
||||
onClick(node);
|
||||
};
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ function renderNode(d, props, graphContext) {
|
||||
transform={graphContext.state.transform}
|
||||
getNodeById={graphContext.getNodeById}
|
||||
selectedElements={graphContext.state.selectedElements}
|
||||
style={d.style}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user