I'm trying to implement drag and drop in a React Native application.
Has anyone out there used this ? Somehow I'm not able to drag the text. There are not enough steps to use the npm module.
After debugging for some time I found that onLayout & onLongPress are undefined, can anyone help me on this ?
Assuming you're new to React Native (as am I, kind of), and you don't have an example of your code, there might be a few things going on. (and there is a high chance you already know all of these things).
Did you follow this example? Here they set onLayout and onLongPress as the props of the DraggableThing component. Next they call the component with functions (onDragItemLayout, startDragHandler) bound to these properties. These functions are supplied by importing the createDropZone, did you import everything?
If you did, importing third-party components is kind of a hassle, because most of the times you're required to do some things in xCode. Not sure if that's also the case right now, but it might be something to look into.
Also my advice would be to take a look at the module supplied in the answer above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With