question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PinchGestureHandler is not supported?

See original GitHub issue

Description

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:closed
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
terrysahaidakcommented, Aug 28, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found