react-native-gesture-handler
react-native-gesture-handler copied to clipboard
Passing some props to Pressable crashes it on iOS
Description
Passing onPointer* and onMoveShouldSetResponder* props to RNGH Pressable causes the following error on iOS:
Exception thrown while executing UI block:
-[RNGestureHandlerButton setOnPointerDown:]:
unrecognized selector sent to instance 0x101979870
This issue doesn't occur on the RN Pressable.
On RN Pressable, unrecognised props are simply ignored.
Steps to reproduce
Use the following repro in place of our paper example app:
import React from 'react';
import { StyleSheet } from 'react-native';
import {
GestureHandlerRootView,
Pressable,
} from 'react-native-gesture-handler';
export default function App() {
return (
<GestureHandlerRootView>
<Pressable
style={styles.button}
onPointerDown={() => console.log('Pressable touchStart')}
onMoveShouldSetResponder={() => true}
/>
</GestureHandlerRootView>
);
}
const styles = StyleSheet.create({
button: {
width: 200,
height: 200,
borderRadius: 30,
backgroundColor: '#1db954',
},
});
Snack or a link to a repository
https://github.com/software-mansion/react-native-gesture-handler/
Gesture Handler version
2.25.0
React Native version
0.76.6
Platforms
iOS
JavaScript runtime
Hermes
Workflow
Expo managed workflow
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
iPhone 16 Pro (simulator)
Acknowledgements
Yes