Skip to content

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

@basitmir

Description

@basitmir

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions