1

I have a parent component (ReactNativeZoomableView) in it there a nested component with clickable elements, the issue is that I want user to be able to press on the element to open it's sidemenu or press and pan to move around the screen.

library used https://www.npmjs.com/package/@openspacelabs/react-native-zoomable-view?activeTab=readme#pan-responder-hooks

Panning outside Element works fine, just on the element it doesnt.

<ReactNativeZoomableView
  ref={zoomRef}
  maxZoom={1.5}
  minZoom={0.5}
  initialZoom={1}
>
<Svg 
  width={width} 
  height={height}
  style={{backgroundColor:'red'}}
>
 {nodeElements.map((element, element) => {
   <Element
     element={element}
     element={element}
    />
 }}
</Svg>
</ReactNativeZoomableView>

The Element looks like the following:

<G
 onPress={handlePress}
>
.....
</G>

I have tried using onMoveShouldSetResponderCapture to have the pan event handled by the parent, that didnt work. Tried having pandhandlers also didnt work.

Sorry if the post is in bad structure, will provide any needed code or info. Thanks in advance

MA.Hammoud
  • 63
  • 7

0 Answers0