title: Why I am not able to use method of an external api in my react native project?
body: <p>I am writing a map related app where I want to show clusters of markers. To do so I use <a href="https://www.npmjs.com/package/react-native-map-clustering" rel="nofollow noreferrer">this</a> API as shown in the read.me file. I am able to see the clusters and the behavior is as expected. However, I want to use another method from the API when the user clicks on a cluster - <code>onClusterPress(cluster, markers)</code> as described from the API. For the time being, I wanted to put a simple <code>console.log</code> so I am sure that the method is being called:</p>
  <pre><code>import MapView from &quot;react-native-map-clustering&quot;;
  
  ....
  &lt;MapView
          style={styles.map}
          initialRegion={initialRegion}
          onClusterPress={(cluster, markers) =&gt; {
            console.log(&quot;cluster was pressed: &quot;, cluster);
          }}
          clusterColor={&quot;pink&quot;}
          ref={mapRef}
        &gt;
     ...
  </code></pre>
  <p>Unfortunately, nothing is printed on the console.</p>
  <p>Just for the sake of testing - I copy pasted the code from <code>React Native Map Clustering</code> into my project. There were 3 files in total - <code>ClusteredMapView.js</code>, <code>ClusteredMarker.js</code>, <code>helper.js</code></p>
  <p>So, rather than using <code>import MapView from &quot;react-native-map-clustering&quot;;</code> I imported <code>import ClusteredMapView from &quot;./ClusteredMapView&quot;;</code> and changed the above code to:</p>
  <pre><code>&lt;ClusteredMapView
          style={styles.map}
          initialRegion={initialRegion}
          onClusterPress={(cluster, markers) =&gt; {
            console.log(&quot;cluster was pressed: &quot;, cluster);
          }}
          clusterColor={&quot;pink&quot;}
          ref={mapRef}
        &gt;
  </code></pre>
  <p>And now, when I press on a map cluster, I am able to see <code>console.log</code></p>
  <p>Can someone explain to me why this is happening given that I just copy-pasted the code from the github repo into my project (I didn't change anything)?</p>
  <p>And my second question - how I should be able to use the method from the original API without copy-pasting code?</p>