Questions tagged [react-native-gesture-handler]

263 questions
5
votes
0 answers

React Native programmatically swipe gesture on element

In this fantastic video, made by William Candillon from http://start-react-native.dev he shows how to make this off-screen menu. Code can be found here: https://github.com/wcandillon/can-it-be-done-in-react-native/tree/master/the-10-min/src/Menu My…
4
votes
2 answers

How do I implement a drag after a long press using React Native Gesture Handler v2?

The docs say: Simply set manualActivation to true on a PanGesture and use StateManager to fail the gesture if the user attempts to drag the component sooner than the duration of the long press. However, I can't figure out how to measure timing in…
4
votes
1 answer

How do you implement React-native-gesture-handler with React Navigation 6.x Native Stack Navigator (RN>0.6)?

So, I am building a prototype android app as an internship project for a startup in React Native v0.66. I was new to RN but not React when I set up the project. My choice for navigation fell upon React Navigation 6.x and their Native Stack Navigator…
4
votes
1 answer

React-native-reanimated 2: How do I update Text in response to PanGestureHandler?

Here is my component. It's a simple PanGestureHandler with some svg. import React from 'react' import { StyleSheet, View, Text } from 'react-native' import Svg, { Circle, Line } from 'react-native-svg' import Layout from '../constants/Layout' import…
4
votes
0 answers

React Native: Get actual x,y co-ordinates of an element after finish dragging (react-native-gesture-handler)

I'm using this library: https://github.com/software-mansion/react-native-gesture-handler I'm a bit confused of how to get the actual x,y co-ordinates of an element. I'm explaining... This is the initial state: After dragging, with…
Encrypted
  • 628
  • 1
  • 10
  • 22
4
votes
1 answer

PanGestureHandler with functional component react native

I am trying to use a Gesture handler with a functional component. The problem is when I drag for the second time it's dragging from initial position again This is my code below let translateXRef = useRef(new Animated.Value(0)).current; const…
vinbhai4u
  • 1,329
  • 3
  • 19
  • 36
4
votes
0 answers

In React Native, how can I adjust translation values when scaling an animated view, so that scaling appears to have an origin at an arbitrary point?

I am using PanGestureHandler and PinchGestureHandler to allow a large image to be panned and zoomed in/out on the screen. However, once I introduce the scaling transformation, panning behaves differently. I have three goals with this…
4
votes
1 answer

Position resets to 0 while using PanGestureHandler from react-native-gesture-handler

import React, { useRef, useState, useCallback } from 'react'; import { View, Animated } from 'react-native'; import { PanGestureHandler } from 'react-native-gesture-handler'; const InfoBox = ({ info }: Props) => { const [currenPos,…
4
votes
0 answers

How to use BottomSheet inside model

I want to add bottom sheet in Modal. I am using reanimated-bottom-sheet and react native modal. But when I use BottomSheet inside Modal gesture not work and can't closeBottomSheet with swiping down. I searched and I found this is RCGH problem. So I…
4
votes
2 answers

Why can't I get a nativeEvent callback to fire in React Native's Animated.event()?

Why isn't the nativeEvent callback firing in my Animated.event call when a box is dragged? My ultimate goal is to implement logic to prevent draggable gesture-controlled components from going off-screen, but I can't do that until I figure out why…
4
votes
2 answers

react native gesture handler is not working with modal in Android

I am having an issue in using PanGestureHandler from react-native-gesture-handler with Modal. This is perfectly working in iOS but not in android. And Moreover when I changed Modal in to View component it is working in Android as well. Please any…
4
votes
0 answers

RN Gesture handler and Flatlist

I have wrapped inside and I want the pan gesture to take over when Flatlist has reached the top. Something similar to Spotify’s Music Player when it is expanded in full screen. Any help is appreciated.
4
votes
2 answers

Getting error Invariant Violation: Tried to register two views with the same name

I have used react-native when it was 0.50 now I'm using it again and it's 0.61.1 I am making an app and using "react-navigation" library for routing. Since I'm using the react-native-gesture-handler according to the documentation I'm getting the…
4
votes
0 answers

IllegalStateExceptioncom.swmansion.gesturehandler.GestureHandler in prepare

I'm facing some random crash in production on Android. Here is the logcat give me that: 2019-11-20 15:00:09.752 3248-3248/? E/InputEventReceiver: Exception dispatching input event. 2019-11-20 15:00:09.752 3248-3248/? E/MessageQueue-JNI: Exception in…
4
votes
1 answer

Touch events are not working with react navigation

According to the steps of React Navigation 3.x documentation, I have added react-native-gesture-handler for android. I have added the additional lines in MainActivity.java too. Here is the link for…
1
2
3
17 18