Skip to content

Commit f922b3b

Browse files
authored
Export PressableEvent type (#4324)
## Description As stated in [this discussion](#3512), `PressableEvent` is not exported. This PR adds this export. ## Test plan <details> <summary>Tested on the following code:</summary> import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import type { PressableEvent } from 'react-native-gesture-handler'; import { Pressable } from 'react-native-gesture-handler'; export default function EmptyExample() { const handlePress = (e: PressableEvent) => { console.log(e.nativeEvent.changedTouches); }; return ( <View style={styles.container}> <Pressable onPress={handlePress} /> <Pressable onPress={(e) => { console.log(e.nativeEvent.changedTouches); }} /> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', }, }); </details>
1 parent 1e4378b commit f922b3b

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export { default } from './Pressable';
22
export type {
33
LegacyPressableProps,
4+
PressableEvent,
45
PressableProps,
56
PressableStateCallbackType,
67
} from './PressableProps';

packages/react-native-gesture-handler/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export {
2525
export { default as GestureHandlerRootView } from './components/GestureHandlerRootView';
2626
export type {
2727
LegacyPressableProps,
28+
PressableEvent,
2829
PressableProps,
2930
PressableStateCallbackType,
3031
} from './components/Pressable';

0 commit comments

Comments
 (0)