Eliav2 / react-xarrows

Draw arrows (or lines) between components in React!
https://codesandbox.io/embed/github/Eliav2/react-xarrows/tree/master/examples?fontsize=14&hidenavigation=1&theme=dark
MIT License
584 stars 75 forks source link

Fix line SVG dotted animation in strict mode #174

Open Reflejo opened 1 year ago

Reflejo commented 1 year ago

This was broken in strict mode. I honestly am not sure how this worked before since lineDrawAnimRef (https://github.com/Eliav2/react-xarrows/blob/master/src/Xarrow/Xarrow.tsx#L175) will always be undefined (if no drawing animation happens), therefore handleDrawAmimEnd is never called.

Fixes https://github.com/Eliav2/react-xarrows/issues/151