From 7489f213d859c30f17fbfee3a890fc54cce1fa12 Mon Sep 17 00:00:00 2001 From: Simon-TechForm <73996878+Simon-TechForm@users.noreply.github.com> Date: Mon, 4 Oct 2021 15:30:55 +0200 Subject: [PATCH] feat(MapView): remove redundant onMarkerPress interception See #1741. I'm not really sure if it fixed anything back then, or just helped making it easier to access the data of the nativeEvent. Either way, this will never be called today, as the consumer-provided prop will override this, as the consumer props are spread AFTER this is passed, as opposed to back when the fix was introduced. --- src/MapView.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/MapView.tsx b/src/MapView.tsx index f8c267b05..db79da712 100644 --- a/src/MapView.tsx +++ b/src/MapView.tsx @@ -171,7 +171,6 @@ class MapView extends React.Component { }; this._onMapReady = this._onMapReady.bind(this); - this._onMarkerPress = this._onMarkerPress.bind(this); this._onChange = this._onChange.bind(this); this._onLayout = this._onLayout.bind(this); } @@ -259,12 +258,6 @@ class MapView extends React.Component { } } - _onMarkerPress(event) { - if (this.props.onMarkerPress) { - this.props.onMarkerPress(event.nativeEvent); - } - } - private _onChange({ nativeEvent }: ChangeEvent) { this.__lastRegion = nativeEvent.region; const isGesture = nativeEvent.isGesture; @@ -587,7 +580,6 @@ class MapView extends React.Component { props = { region: null, initialRegion: null, - onMarkerPress: this._onMarkerPress, onChange: this._onChange, onMapReady: this._onMapReady, onLayout: this._onLayout, @@ -606,7 +598,6 @@ class MapView extends React.Component { style: this.props.style, region: null, initialRegion: null, - onMarkerPress: this._onMarkerPress, onChange: this._onChange, onMapReady: this._onMapReady, onLayout: this._onLayout,