Exception in HostFunction: Expected argument 1 of method "attachGestureHandler" to be a number, but got null
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>
);
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
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.
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?
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.