I want to call useXarrow with onClick
AdarshPawar29 opened this issue · 1 comments
AdarshPawar29 commented
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
Eliav2 commented
settimeout wont help you here. you need to call 'updateXarrow' when animations finished and not onClick, because after a click the positions shift