title: How to disable the default context menu of react native webview, and call a react prop instead of native one?
body: <p>I need to disable the default context menu that pops up on selecting text inside a webview, and instead handle this event from javascript side.</p>
  
  <p>I added the following code in <code>RNCWebview.m</code> after some initial research,</p>
  
  <pre class="lang-js prettyprint-override"><code>- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
     NSLog(@"From native side");
     return NO;
  }
  </code></pre>
  
  <p>and then passed a <code>onSelection</code> prop from where I rendered my component. I gave console.logs in my node modules and got this object as props to the webview</p>
  
  <pre><code>{"cacheEnabled": true, "javaScriptEnabled": true, "onSelection": [Function onSelection], "originWhitelist": ["http://*", "https://*"], "source": {"uri": "https://www.google.com"}, "style": {"height": 500}, "useSharedProcessPool": true}
  </code></pre>
  
  <p>But I am not sure how to handle this function and call it from objective-c code. But still the context menu shows up when I select some text in the webview and the <code>onSelection</code> prop is not getting called. </p>
  
  <p>I am sure I am missing some link here. Please help</p>