urbica / react-map-gl-draw

React Component for Mapbox GL Draw
https://urbica.github.io/react-map-gl-draw
MIT License
50 stars 10 forks source link

fix: Deregister event callbacks on control removal #15

Closed oselz closed 4 years ago

oselz commented 4 years ago

Currently unmounting the Draw component (or changing the position) does not deregister the event callbacks, so next time the component is mounted you get multiple event callbacks.

This change deregisters the calls backs on unmount or position change.

stepankuzmin commented 4 years ago

Thanks @oselz! Released as v0.3.3

oselz commented 4 years ago

@stepankuzmin It seems your release didn't build correctly, the dist directory is missing.

stepankuzmin commented 4 years ago

Good catch, my bad. Fixed in v0.3.4