I am trying do simple drag and drop functionality. I want set some data in on drag via dataTransfer.setData() and get it on drop via dataTransfer.getData() . I am always getting empty string ("").
Please check the link for reproducing example https://codesandbox.io/s/quizzical-lamport-p7cqiv?file=/src/Sample.js
drag and drop and check console
My Environment:
Browser: Chrome
OS: Windows
React UI library
You're using the wrong event. You should use the
onDragStart
event: