fix(elements): change data from outside

This commit is contained in:
moklick
2019-07-17 17:34:42 +02:00
parent a5aa78f02a
commit 1dbeebfb27
8 changed files with 59 additions and 33 deletions
+4 -1
View File
@@ -20,7 +20,10 @@ export const Provider = (props) => {
const existingNode = state.nodes.find(n => n.data.id === propNode.data.id);
if (existingNode) {
return Object.assign(propNode, existingNode);
return {
...existingNode,
data: { ...existingNode.data, ...propNode.data }
};
}
return propNode;