Open latekvo opened 21 hours ago
When Animated.View is either the root element, or an n+1 child (2nd, 3rd) of the root in a component created using forwardRef, the very first native interactive element is disabled, no longer calling onPress callbacks.
Animated.View
forwardRef
onPress
derived from this issue: https://github.com/software-mansion/react-native-gesture-handler/issues/3223
rngh
rea
https://github.com/software-mansion/react-native-gesture-handler/blob/main/example/src/empty/EmptyExample.tsx
3.16.2
0.74.1
Android, iOS
Hermes
Expo Dev Client
Paper (Old Architecture)
Debug app & dev bundle
Real device, emulator
Xiaomi POCO X3 Pro, Pixel 3a emulator
Yes
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?
Description
When
Animated.View
is either the root element, or an n+1 child (2nd, 3rd) of the root in a component created usingforwardRef
, the very first native interactive element is disabled, no longer callingonPress
callbacks.derived from this issue: https://github.com/software-mansion/react-native-gesture-handler/issues/3223
Reproduction code
Expected behaviour example
```jsx import React, { forwardRef, useCallback } from 'react'; import Animated from 'react-native-reanimated'; import { Text, I18nManager, StyleSheet, TouchableOpacity, View, } from 'react-native'; interface SwipeableMethods { close: () => void; openLeft: () => void; openRight: () => void; reset: () => void; } const Example = forwardRefInvalid behaviour, left element non-interactive, `Animated.View` wrapping the right element
```jsx import React, { forwardRef, useCallback } from 'react'; import Animated from 'react-native-reanimated'; import { Text, I18nManager, StyleSheet, TouchableOpacity, View, } from 'react-native'; interface SwipeableMethods { close: () => void; openLeft: () => void; openRight: () => void; reset: () => void; } const Example = forwardRefInvalid behaviour, left element non-interactive, `Animated.View` is the root element
```jsx import React, { forwardRef, useCallback } from 'react'; import Animated from 'react-native-reanimated'; import { Text, I18nManager, StyleSheet, TouchableOpacity, View, } from 'react-native'; interface SwipeableMethods { close: () => void; openLeft: () => void; openRight: () => void; reset: () => void; } const Example = forwardRefExpected behaviour, `Animated.View` wrapping the left element
```jsx import React, { forwardRef, useCallback } from 'react'; import Animated from 'react-native-reanimated'; import { Text, I18nManager, StyleSheet, TouchableOpacity, View, } from 'react-native'; interface SwipeableMethods { close: () => void; openLeft: () => void; openRight: () => void; reset: () => void; } const Example = forwardRefSteps to reproduce
rngh
or therea
example apps, in place of the empty exampleSnack or a link to a repository
https://github.com/software-mansion/react-native-gesture-handler/blob/main/example/src/empty/EmptyExample.tsx
Reanimated version
3.16.2
React Native version
0.74.1
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
Expo Dev Client
Architecture
Paper (Old Architecture)
Build type
Debug app & dev bundle
Device
Real device, emulator
Device model
Xiaomi POCO X3 Pro, Pixel 3a emulator
Acknowledgements
Yes