Site icon May's Notes

react-beautiful-dnd 警告及解決方式匯總

react

react-beautiful-dnd Unable to find draggable with id: 1

{list.map((item, index) => (
  <DraggableItem route={item} index={index} />
))}
<Draggable
  draggableId={data.id.toString()}
  index={index}
>
    ...
</Draggable>

解決方法:

刪除 <React.StrictMode></React.StrictMode>

placeholder could not be found

Droppable setup issue [droppableId: "test"]:DroppableProvided > placeholder could not be found.Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.

解決方式:

<Droppable></Droppable> 內加上 {provided.placeholder}

Exit mobile version