1

I am warping a gesture handler from react-native-gesture-handler with animated flatlist from react-native-reanimated

import Animated from "react-native-reanimated"
import { NativeViewGestureHandler } from "react-native-gesture-handler"

...

 <NativeViewGestureHandler>
              <Animated.FlatList
                 ...
              />
  </NativeViewGestureHandler>

And this error pops.

Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

Check the render method of `NativeViewGestureHandler`.

How could I solve this issue?

Edit: When I change the Animated.FlatList to FlatList from react-native / react-native-gesture-handler, it works fine. And I'm not using ref on this screen at all.

I also tried to update to lastest version (2.5.0) of react-native-gesture-handler. Exactly the same error as above mentioned.

Dependencies version:

    "expo": "~44.0.0",
    "react-native-reanimated": "~2.3.1",
    "react-native-gesture-handler": "~2.1.0",
chunghn
  • 121
  • 8
  • Currently I leave the error there since I'm not using the ref. You are welcome to update here if there are any changes. – chunghn Jul 26 '22 at 10:22

0 Answers0