problem description
React dnd develops a drag-and-drop function, how to put the dragged element in a certain location in the target box?
the environmental background of the problems and what methods you have tried
the content in the drag target box is an array, which is an array formed by dragging, so how do you insert this element into an element in the array when you drag and drop?
insert data into an array. I know how to use splice, but how to get the inserted subscript?
related codes
const spec = {
hover(props,monitor){
console.log("props index--->",props);
},
};
what result do you expect? What is the error message actually seen?
I want to get the insert subscript of the inserted data when I drag and drop
, but the props.index in the above code always prints undefined
Gods, how do I get this? Please also give me some advice. Thank you