You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add relation props to Pressable and ReanimatedSwipeable (#3473)
## Description
It has been reported that if `Pressable` is placed under the view with
attached `GestureDetector`, it doesn't work since it gets cancelled by
other gestures. This PR adds relation properties to `Pressable` and
`ReanimatedSwipeable`, so we can make interactions with external
handlers possible.
> [!NOTE]
> This change was partially added into `ReanimatedSwipeable` in #3324
## Test plan
<details>
<summary>Tested on the following example:</summary>
```jsx
import React from 'react';
import { StyleSheet, View } from 'react-native';
import {
Gesture,
Pressable,
GestureDetector,
GestureHandlerRootView,
} from 'react-native-gesture-handler';
export default function App() {
const gesture = Gesture.Pan();
return (
<GestureHandlerRootView>
<GestureDetector gesture={gesture}>
<View style={styles.buttonContainer} collapsable={false}>
<Pressable
style={styles.button}
onPressIn={() => console.log('Pressable onPressIn')}
onPressOut={() => console.log('Pressable onPressOut')}
simultaneousWithExternalGesture={gesture}
/>
</View>
</GestureDetector>
</GestureHandlerRootView>
);
}
const styles = StyleSheet.create({
buttonContainer: {
flex: 1,
alignItems: 'center',
justifyContent: 'space-around',
backgroundColor: '#535353',
},
button: {
width: 200,
height: 200,
borderRadius: 30,
backgroundColor: '#1db954',
},
});
```
</details>
0 commit comments