0.1.11 • Published 2 years ago
react-native-contains v0.1.11
react-native-contains
Universal element contains for react, react-native, and react-native web
Example 1
import { useRef } from "react",
import { View } from "react-native",
import contains from "react-native-contains";
function Component() {
const ref = useRef();
return (
<View>
<View ref={ref}>
<View onPress={((event) => {
contains(ref.current, event.target); // true
})}/>
</View>
<View onPress={((event) => {
contains(ref.current, event.target); // false
})}/>
</View>
)
}