PinchGestureHandler is not supported?
See original GitHub issueDescription
PinchGestureHandler is not supported?
Code
const Test: FunctionComponent = () => {
const onGestureEvent = useAnimatedGestureHandler({
onActive: () => {
console.info('active');
},
});
return (
<PinchGestureHandler onGestureEvent={onGestureEvent}>
<Animated.View >
</Animated.View>
</PinchGestureHandler>
);
};
typescript error
No overload matches this call.
Overload 1 of 2, '(props: Readonly<PinchGestureHandlerProperties>): PinchGestureHandler', gave the following error.
Type 'OnGestureEvent' is not assignable to type '(event: PinchGestureHandlerGestureEvent) => void'.
Types of parameters 'event' and 'event' are incompatible.
Type 'PinchGestureHandlerGestureEvent' is not assignable to type 'PanGestureHandlerGestureEvent'.
Types of property 'nativeEvent' are incompatible.
Type 'GestureHandlerGestureEventNativeEvent & PinchGestureHandlerEventExtra' is not assignable to type 'NativeEvent'.
Type 'GestureHandlerGestureEventNativeEvent & PinchGestureHandlerEventExtra' is missing the following properties from type 'PanGestureHandlerEventExtra': x, y, absoluteX, absoluteY, and 4 more.
Overload 2 of 2, '(props: PinchGestureHandlerProperties, context?: any): PinchGestureHandler', gave the following error.
Type 'OnGestureEvent' is not assignable to type '(event: PinchGestureHandlerGestureEvent) => void'.
Package versions
“react”: “16.13.1”, “react-native”: “0.63.2”, “react-native-gesture-handler”: “1.7.0”, “react-native-reanimated”: “2.0.0-alpha.5”,
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
PinchGestureHandler not working on android - Stack Overflow
i have an android device, and it is not working, dont know why please help!!!!! beside this PanGestureHandler working perfectly.
Read more >PinchGestureHandler | React Native Gesture Handler
A continuous gesture handler that recognizes pinch gesture. It allows for tracking the distance between two fingers and use that information to scale...
Read more >The basics of PinchGestureHandler with React ... - YouTube
In this tutorial we'll learn how to use the PinchGestureHandler component (from react-native-gesture-handler package).
Read more >GestureHandler - Expo Documentation
This library provides an API that exposes mobile platform specific native capabilities of touch & gesture handling and recognition.
Read more >Adding Pinch-to-Zoom Gestures with React Native - Crowdbotics
If you are working with lower versions of React Naive, ... you do not have to install and set up the Gesture Handler...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You should pass it as a generic parameter of useAnimatedGestureHandler. Here you can find an example https://www.github.com/terrysahaidak/reanimated-gallery/tree/master/src%2FImageTransformer.tsx
@ehsan6sha Try this: https://github.com/enzomanuelmangano/animate-with-reanimated/blob/main/04-pinch-gesture-handler-basics/App.tsx