Skip to content

Instantly share code, notes, and snippets.

View cuongtranduc's full-sized avatar
🏠
Working from home

cuongtd cuongtranduc

🏠
Working from home
  • Ha Noi, Viet Nam
View GitHub Profile
@cuongtranduc
cuongtranduc / react-native-detect-press-outside
Last active October 5, 2021 16:30
detect a tap outside of element in React Native
<View
onStartShouldSetResponder={(evt) => {
evt.persist();
if (!isTapInsideComponent((evt.target, this.childrenRef.current))) {
console.log("Press outside of component");
}
}}>
<View>
<View
ref={(component) => {

Keybase proof

I hereby claim:

  • I am cuongtranduc on github.
  • I am cuongtd (https://keybase.io/cuongtd) on keybase.
  • I have a public key ASA98p6pmFF_xKFpMHQ7xmnoaaLtlkyffqdSxC1K0aem0go

To claim this, I am signing this object: