Open vjpr opened 7 years ago
Hey @vjpr thanks for the issue, it seems like a critical issue. I am not spending much time maintaining this library to be honest so if you want to go ahead with a fix for this it is welcome. Otherwise I will try to find some time to analyse / fix this later next week.
If
draw
is set to something, this equality check will fail causing re-rendering every time there is an update.The issue is in
updateDrawControls
. Looks like a reference tothis.props.draw
is being passed directly tooptions.draw
which is then mutated byleaflet-draw
.Props should be immutable.
this.props.draw
should be cloned before passing tooptions.draw
react-leaflet
handles the viewport. See https://github.com/PaulLeCam/react-leaflet/blob/master/docs/Components.md#map