Skip to content

Commit e62525e

Browse files
authored
add manualActivation prop (#3923)
## Description `manualActivation` prop was missing in v3, this PR adds it. ## Test plan <details> ```tsx import React from 'react'; import { View, Text, StyleSheet } from 'react-native'; import { GestureHandlerRootView, GestureDetector, usePanGesture } from 'react-native-gesture-handler'; export default function TwoPressables() { const pan = usePanGesture({ onActivate: (e) => { console.log(e) }, disableReanimated: true, manualActivation: true, runOnJS: true, }); return ( <GestureHandlerRootView> <View style={styles.root}> <GestureDetector gesture={pan}> <View style={styles.outer}> <Text style={styles.label}>Pan</Text> </View> </GestureDetector> </View> </GestureHandlerRootView> ); } const styles = StyleSheet.create({ root: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#f7f7f7', }, outer: { padding: 20, backgroundColor: '#ddd', borderRadius: 12, marginBottom: 50 }, label: { fontSize: 18, marginBottom: 10, }, }) ``` </details>
1 parent ef4a33e commit e62525e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/react-native-gesture-handler/src/v3/hooks/utils/propsWhiteList.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const CommonConfig = new Set<keyof CommonGestureConfig>([
2222
'activeCursor',
2323
'mouseButton',
2424
'testID',
25+
'manualActivation',
2526
]);
2627

2728
const ExternalRelationsConfig = new Set<keyof ExternalRelations>([

packages/react-native-gesture-handler/src/v3/types/ConfigTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export type CommonGestureConfig = {
6666
activeCursor?: ActiveCursor;
6767
mouseButton?: MouseButton;
6868
cancelsTouchesInView?: boolean;
69+
manualActivation?: boolean;
6970
},
7071
HitSlop | ActiveCursor | MouseButton
7172
>;

0 commit comments

Comments
 (0)