From abc28eeb889224a1ec5d297db547126891b4c8d6 Mon Sep 17 00:00:00 2001 From: Stepan Kuzmin Date: Mon, 3 Aug 2020 09:17:29 +0300 Subject: [PATCH] fix(marker): properly remove onClick event listener on unmount --- src/components/Marker/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Marker/index.js b/src/components/Marker/index.js index 95cf6c7c..f69a7b16 100644 --- a/src/components/Marker/index.js +++ b/src/components/Marker/index.js @@ -160,7 +160,7 @@ class Marker extends PureComponent { } if (this.props.onClick) { - this._el.addEventListener('click', this.props.onClick); + this._el.removeEventListener('click', this.props.onClick); } this._marker.remove();