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

Exception in HostFunction: Expected argument 1 of method "attachGestureHandler" to be a number, but got null

Open basitmir opened this issue 8 months ago • 3 comments

Description

i am using "react-native-gesture-handler": "^2.25.0", "react-native-reanimated": "^4.0.0-beta.5",

const pressed = useSharedValue<boolean>(false);
    const tap = Gesture.Tap()
        .onBegin(() => {
            pressed.value = true;
        })
        .onFinalize(() => {
            pressed.value = false;
        });

    const animatedStyles = useAnimatedStyle(() => ({
        backgroundColor: pressed.value ? '#FFE04B' : '#B58DF1',
        transform: [{ scale: withTiming(pressed.value ? 1.2 : 1) }],
    }));
return (
        <View style={styles.container}>
            <GestureDetector gesture={tap}>
                <Animated.View style={[styles.circle, animatedStyles]} />
            </GestureDetector>
        </View>
    );

Image

Steps to reproduce

its very simple just update the react-native-reanimated and use new arch

A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.

https://docs.swmansion.com/react-native-reanimated/docs/next/

Gesture Handler version

2.25.0

React Native version

0.77.0

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

New Architecture (Fabric)

Build type

Debug mode

Device

Real device

Device model

No response

Acknowledgements

Yes

basitmir avatar Jun 04 '25 07:06 basitmir

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Snack or a link to a repository section.

github-actions[bot] avatar Jun 04 '25 07:06 github-actions[bot]

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

github-actions[bot] avatar Jun 04 '25 07:06 github-actions[bot]

Hi! This issue seems to affect react-native 0.77. I've tested that on 0.79.2 and it works fine. Given that 0.80 is right around the corner, I'd suggest to update rn verison. Alternatively Reanimated 3.18.0 should also work.

m-bert avatar Jun 06 '25 11:06 m-bert