我正在尝试构建一个简单的可拖动对象实现,react-beautiful-dnd
但显然我的可拖动对象不会移动。
这是我在 CodeSandbox 中的示例代码:
我正在尝试构建一个简单的可拖动对象实现,react-beautiful-dnd
但显然我的可拖动对象不会移动。
这是我在 CodeSandbox 中的示例代码:
只需style
从子级中删除属性draggable
(在您的情况下它是Block
组件)。DnD 使用它自己的style
属性并且你覆盖它。你必须使用它来className
代替它。
你的例子没有style
:
https://codesandbox.io/s/using-react-beautiful-dnd-with-hooks-1m4zm