Start app and press Toggle Edit button. Controls should be enabled, and drawing works as normal.
Toggle Edit twice so that the Edit Controls are deleted and created again. Draw anything, and the create function will be triggered twice.
Toggling each time adds another extra trigger for the function, so I'm guessing that the bindings for draw:create (and possibly other signals) are not being destroyed properly when the React component is destroyed.
I can't see any code in the react-leaflet-draw source that relates to React component destructors; my understanding was that this was abstracted by React (or possibly by react-leaflet).
Got the bug to work with a minimal example Use this file instead of editcontrol.js on the minimal example in the repo https://gist.github.com/ALTinners/6a15e4f1ad2653ee23d1d15132f46a8f
To replicate:
I can't see any code in the react-leaflet-draw source that relates to React component destructors; my understanding was that this was abstracted by React (or possibly by react-leaflet).