title: How to prevent parent click event in react native?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>onParentClick = () =&gt; {
    console.log('Parent is triggered');
  }
  
  onChildClick = (event) =&gt; {
    event.stopPropagation();
    console.log('Child is triggered');
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;TouchableWithoutFeedback onPress={()=&gt; this.onParentClick()}&gt;
    &lt;View&gt;
      &lt;Text&gt;How to prevent parent click event&lt;/Text&gt;
      &lt;TouchableOpacity onPress={(event)=&gt; this.onChildClick(event)}&gt;
        &lt;Text&gt; Click Me &lt;/Text&gt;
      &lt;/TouchableOpacity&gt;
    &lt;/View&gt;
  &lt;/TouchableWithoutFeedback&gt;
  &lt;!-- edit description:- there was this end curly brace missing in above,
   however the snippet will not run because the language js will not 
  support it and language html will not be able to format it correctly or run it.
  (need to run the snippet on the react native environment like code-pen)  --&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Expected: On click of "Click Me", onChildClick() must be called</p>
  <p>Issue: On click of "Click Me", onParentClick() is called.</p>
  How to prevent parents click event on click of "Click Me"?
  <p>Result which I get on click of parent is "Parent is triggered" and it works perfect.</p>
  <p>But on click on child the result I get is "Parent is triggered".</p>
  <p>I guess onChildClick() is not being triggered.</p>