-
As the title states, I was implementing a project that basically had a <TapGestureHandler waitFor={[controller1Ref, controller2Ref]}>
<TapGestureHandler ref={controller1Ref}>
<Text style={{ backgroundColor: 'blue', padding: 20 }}>
Controller 1
</Text>
</TapGestureHandler>
<TapGestureHandler ref={controller2Ref}>
<Text style={{ backgroundColor: 'blue', padding: 20 }}>
Controller 2
</Text>
</TapGestureHandler>
</TapGestureHandler> However, it never passed the compilation as it always triggered an unreadable error as I was testing this through Snack on Expo. Any modifications or guidance will be much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Gesture handlers need a component to wrap onto (and should have only one child). Try doing something like this: <TapGestureHandler waitFor={[controller1Ref, controller2Ref]}>
<View>
<TapGestureHandler ref={controller1Ref}>
<Text style={{ backgroundColor: 'blue', padding: 20 }}>
Controller 1
</Text>
</TapGestureHandler>
<TapGestureHandler ref={controller2Ref}>
<Text style={{ backgroundColor: 'blue', padding: 20 }}>
Controller 2
</Text>
</TapGestureHandler>
</View>
</TapGestureHandler> (use |
Beta Was this translation helpful? Give feedback.
Gesture handlers need a component to wrap onto (and should have only one child). Try doing something like this:
(use
Animated.View
instead if you're using Animated or Reanimated)