react-native-china / react-native-ART-doc

📒 Unofficial documentation for react-native ART module.
228 stars 28 forks source link

How to set click event of shape area in react native ? #12

Closed ap050492 closed 5 years ago

ap050492 commented 5 years ago

Thanks for sharing this valuable documents...

I need write click event of particular Shape which draw using react native ART. How can i achieve this ? can you please share your ideas or thought on this so can i worked on it.

Thanks all...

Obooman commented 5 years ago

For me, I wrap the whole <Surface/> within an <View/>, listen to View events and calculate the position to find out which "element" is the one being clicked on. take this as a reference.

CezarCobuz commented 5 years ago

Tried to wrap a <Shape> with a view, I am developing on web also. I get the following error:

Uncaught Invariant Violation: ReactART does not support the type "div"

How did you resolve this?