这是以下问题的小吃 - https://snack.expo.io/@noitidart/tapgesturehandler-ongestureevent
onGestureEvent
forTapGestureHandler
永远不会触发吗?文档没有说明这一点。这似乎发生在我身上:
import Reanimated from 'react-native-reanimated';
const handleStateChange = () => console.log('state changed');
const handleGestureEvent = () => console.log('got gesture event');
<TapGestureHandler
onHandlerStateChange={handleStateChange}
onGestureEvent={handleGestureEvent}>
<Reanimated.View
style={{ width: 100, height: 100, backgroundColor: 'green' }}
/>
</TapGestureHandler>
您将在点击时看到它永远不会触发(“手势事件”)