答案 0 :(得分:0)
task.js
中存在问题。您忘记传播provided.dragHandleProps
import React from 'react'
import { Draggable } from 'react-beautiful-dnd'
const Task = props => {
console.log(props)
return (
<Draggable draggableId={props.task.id} index={props.index}>
{(provided, snapshot) => (
<div
ref={provided.innerRef} // <-- this as well
{...provided.draggableProps}
{...provided.dragHandleProps} // <-- here
>
{props.task.content}
</div>
)}
</Draggable>
)
}
export default Task