react-native-draggable icon indicating copy to clipboard operation
react-native-draggable copied to clipboard

UseState stops dragging

Open deepakaggarwal7 opened this issue 4 years ago • 3 comments

<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.

deepakaggarwal7 avatar Jul 16 '20 05:07 deepakaggarwal7

I have the same issue ! And I don't see how to solve this

alexandreandriesse avatar Feb 11 '22 11:02 alexandreandriesse

i believe the library is actually dead

lockieluke avatar Feb 18 '22 19:02 lockieluke

I ended up writing my own draggable library using React Native Gesture Handler's PanGestureHandler

lockieluke avatar Feb 20 '22 17:02 lockieluke