react-native-svg icon indicating copy to clipboard operation
react-native-svg copied to clipboard

How to get the coordinates with respect to the root Svg for the onPress event?

Open aditya1711 opened this issue 4 years ago • 2 comments

<Svg
   height={mapContainerViewDims.height}
   width={mapContainerViewDims.width}
   viewBox="0 0 612 792"
   preserveAspectRatio="xMinYMin">
   <G
      onPressIn={({nativeEvent}) => {
      console.log(nativeEvent);
      setToolTipCord({
      x: nativeEvent.pageX ,
      y: nativeEvent.pageY,
      });
      }}>{
      //some other svgs
      }
   </G>
</Svg>

I basically want to show a tooltip kind of component with respect to the location user presses.

aditya1711 avatar Aug 11 '20 07:08 aditya1711