react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

Passing some props to Pressable crashes it on iOS

Open latekvo opened this issue 7 months ago • 0 comments

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

latekvo avatar Apr 04 '25 15:04 latekvo