Dragabbale 不会在 react-beautiful-dnd 中移动

Dragabbale won't move in react-beautiful-dnd

我正在尝试在 react-beautiful-dnd 中构建一个简单的可拖动对象实现,但显然我的可拖动对象不会移动。

这是我在 CodeSandbox 中的示例代码:

https://codesandbox.io/s/using-react-beautiful-dnd-with-hooks-zqpi9?fontsize=14&hidenavigation=1&theme=dark

只需从 draggable 的子项中删除 style 属性(在您的情况下它是 Block 组件)。 DnD 使用它自己的 style 属性,您可以覆盖它。你必须使用 className 而不是它。

你的例子没有 style:
https://codesandbox.io/s/using-react-beautiful-dnd-with-hooks-1m4zm