Replies: 1 comment 3 replies
-
You can use const updateData = () => {
instance.setNodes((nodes) =>
nodes.map((node) => {
if (node.id === id) {
return {
...node,
data: {
inputVal,
}
}
}
return node;
})
);
}; |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a custom node component and depending on the input, I want to update the data attribute of the node and do a similar operation for edges.
`export function MidNode(props: NodeProps) {
const onChange = useCallback((evt) => {
//
}, []);
}`
Beta Was this translation helpful? Give feedback.
All reactions