I have updated the (really great) example provided by daniel-cruz to get it working with current reactflow version.
See it here: https://codesandbox.io/p/sandbox/pensive-cohen-lv4hfx
There are also some other changes:
- Hanlders have always the same color as edge, size is the strokeWidth + 2
- Right mouse click deletes the edge (if clicked on edge) or deletes the handler (if clicked on handler)
- For some reason reactFlowInstance.setEdges() by passing edges in a function does not work correctly, therefore I changed it to combination reactFlowInstance.getEdges() / reactFlowInstance.setEdges(new_edges).
P.S. I am very new to react/web app development (just for 2 days now), it means some parts probably can be made much better.
Example for editable edge in reactflow