react native - TouchableOpacity swallow touch event and never pass -


i'm trying make both onpress happened touchableopacity, second 1 1 fires:

<touchableopacity onpress={() => console.warn('first button')}>   <touchableopacity onpress={() => console.warn('second button')}>     <text>       press me     </text>   </touchableopacity> </touchableopacity> 

how can make both of them fire?

thanks in advance!

you can fire both of them using 'ref' concept , calling props onpress.

<touchableopacity onpress={() =>    alertios.alert('firstbutton')   }    ref={component => this.myfirsttouchable = component} >     <touchableopacity onpress={() =>          {         alertios.alert('second')         this.myfirsttouchable.props.onpress()         }     }>         <text>           press me         </text>       </touchableopacity>     </touchableopacity> 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -