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.

Expo + android: Items aren't dragging

See original GitHub issue

Hello,

I have a managed expo project and am trying to use this package. I have followed the installation instructions as stated for expo here and here: https://docs.expo.dev/versions/latest/sdk/reanimated/ https://docs.expo.dev/versions/latest/sdk/gesture-handler/

I’m not able to drag the items in my list. I added a ScaleDecorator wrapper to check that the drag gets triggered, and the item does rescale, but I’m unable to drag it.

const renderItem = ({ item, index, drag, }: any) => ( <ScaleDecorator> <TouchableOpacity onLongPress={drag} style={styles.draggable}> <Text>{item?.label}</Text> </TouchableOpacity> </ScaleDecorator> );

EDIT: sorry the code is not formatting properly for some reason, I don’t know how to fix it

To Reproduce Since I might have done something wrong, I even copied someone else’s working code and replaced my App.tsx with it, but I still get the same problem when I use the example code: https://snack.expo.dev/@bonehead06/react-native-draggable-flatlist-functional-component

The list renders but I can’t drag the items anywhere.

Platform & Dependencies Please list any applicable dependencies in addition to those below (react-navigation etc).

  • react-native-draggable-flatlist version: ^3.0.5
  • Platform: Developing in Windows / Android
  • Expo version: ~44.0.0
  • Reanimated version: ~2.3.1
  • React Native Gesture Handler version: ~2.1.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
computerjazzcommented, Jan 30, 2022

can you try wrapping your root in a GestureHandlerRootView? see https://github.com/software-mansion/react-native-gesture-handler/issues/1839

1reaction
ericvicenticommented, Mar 24, 2022

Yes thank you, the fix for me was to wrap the app with <GestureHandlerRootView style={{ flex: 1 }}>.

I think this issue can be closed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo: Not able drag in simulator but on real device works fine ...
Experiencing same issue on iOS. Android simulator works fine.
Read more >
react native - Why is expo not refreshing when I save changes?
Android Emulator: Hit Cmd+M, then enable fast refresh in the menu. That would do the trick. Share.
Read more >
Debugging - Expo Documentation
Learn about different techniques and tools available to debug your Expo project.
Read more >
5 common errors found in a React Native app (using Expo)
When creating a mobile app with React Native, you can use Expo to streamline some complexities. Meet the most common errors and how...
Read more >
Drawer Navigator | React Navigation
npx expo install react-native-gesture-handler react-native-reanimated ... Note: If you are building for Android or iOS, do not skip this step, ...
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