Adjust ghost image for drag and drop feature based on React State
I have a drag-and-drop application that reorders an array of cards. When start dragging, I’m removing the dragged item from the array and then putting back on drop based on the new position. Everything works as expected, but because I’m removing the dragged element from the array on dragStart, the ghost image shows as the next item (e.g. when dragging card1, the ghost image shows as card2).