I'm trying to make a connection between two trees with their nodes. I can also have expanded and collapsed functionalities when the user clicks the node. I want to update the position of lines when there is any click/change event taking place. I tried to do this behaviour using setTimeout and it works as expected, but it makes my component keep re-rendering.
I'm trying to make a connection between two trees with their nodes. I can also have expanded and collapsed functionalities when the user clicks the node. I want to update the position of lines when there is any click/change event taking place. I tried to do this behaviour using setTimeout and it works as expected, but it makes my component keep re-rendering.
https://codesandbox.io/s/sharp-wildflower-mit5wp?file=/src/TreeMapView.tsx