react-native-draggable
react-native-draggable copied to clipboard
UseState stops dragging
<View style={styles.container}>
<Draggable
x={30}
y={30}
renderSize={60}
renderColor="black"
renderText=""
isCircle
onDrag={(e, g) => {
setTlX(g.moveX);
setTlY(g.moveY);
}}
/>
</View>
The drag stops working on using set* functions of usestate. If I comment the setTLx and SetTLy, drag starts working again. What's the best way to set the coords in state while dragging. I need this to associate some other element to also change relative to dragged view.
I have the same issue ! And I don't see how to solve this
i believe the library is actually dead
I ended up writing my own draggable library using React Native Gesture Handler's PanGestureHandler