React-Native OnPress event in Svg-Pattern

460 Views Asked by At

Is it possible to add a OnPress event inside a Svg/Pattern/Rect element? I am trying to make clickable cells inside a grid like this:

<Pattern
  id="Grid"
  patternUnits="objectBoundingBox"
  x="0"
  y="0"
  width="50" // polygon.scale * 10 ? 
  height="50" // polygon.scale * 10 ? 
  viewBox="0 0 100 100"
  >
  <Rect width="100" height="100" fill="red" stroke="black" onPress={() =>  
    alert('Press on Circle')} />
</Pattern>

What other options are there?

0

There are 0 best solutions below