我正在按照教程进行操作,但意外收到此错误,有人知道发生了什么吗?
这是完整的错误:
React_devtools_backend.js:2557 React-beautiful-dnd:遇到设置问题。> 不变失败:provided.innerRef 尚未随 HTMLElement 一起提供。您可以在以下位置找到有关使用innerRef回调函数的指南: https: //github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/using-inner-ref.md
可删除代码:
render() {
const { column, clients } = this.props;
return (
<Container>
<Title>{column.name}</Title>
<Droppable droppableId={column.id}>
{(provided) => (
<TaskList
innerRef={provided.innerRef}
{...provided.droppableProps}
>
{clients.map((client, idx) => (
<Task
key={client.id}
client={client}
index={idx}
/>
))}
{provided.placeholder}
</TaskList>
)}
</Droppable>
</Container>
);
}
Run Code Online (Sandbox Code Playgroud)
可拖动代码:
render() {
const { client, index } = this.props;
return (
<Draggable draggableId={client.id} index={index}>
{(provided) => (
<Container
innerRef={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
{client.name}
</Container>
)}
</Draggable>
);
}
Run Code Online (Sandbox Code Playgroud)
谢谢你!!!