react-beautiful-dnd
react-beautiful-dnd copied to clipboard
I can't get the element.
I have three to-do lists and when I swap cases within one list, the last case in the list cannot be dragged and dropped. You can't interact with it in any way at all. And when I try to grab an item in the console I get this warning react-beautiful-dnd.esm.js:39 react-beautiful-dndUnable to find draggable with id: 654621428283905c5b2012adb3. I have each case has a unique id.
Apparently my problem was solved I needed to add the key
- {todos?.tasks?.map((task, index) => (
-
<Draggable index={index} key={task._id} draggableId={task._id.toString()}>
-
{(provided) => (
-
<div className='todos__task'
-
{...provided.draggableProps}
-
{...provided.dragHandleProps}
-
ref={provided.innerRef} >
-
{provided.placeholder}
-
<h1 className='todos__task-title'>{task?.title}</h1>
-
</div>
-
)}
-
</Draggable>
-
))}