Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a draggable component in React Native?

How do I make a draggable component in React Native? I want that when the option is dragged from it's initial position and when I leave it, it should go back to the same position.

enter image description here

like image 531
Shubham Bisht Avatar asked Sep 05 '25 21:09

Shubham Bisht


1 Answers

You can use a library like, https://github.com/tongyy/react-native-draggable to achieve what you want

Or you can use pan responders. For detailed steps, you can take a look at this tutorial: https://moduscreate.com/blog/animated_drag_and_drop_with_react_native

like image 139
Chotala Paresh Avatar answered Sep 08 '25 12:09

Chotala Paresh