0
我有一个组件可以维护一个状态中的对象列表。我打算让这个组件成为一个Drag Source。当Drag事件开始时,我希望拖动组件状态中的对象列表。 问题是Drag Source Spec对象的方法beginDrag将组件的prop作为参数。这意味着可以拖动的对象必须从道具派生。如何访问DragSource规范中的组件状态
draggedItemSpec {
beginDrag(props, monitor, connect)
{
/*how do I access component state here?
Why there is a limitation that when creating dragged object, you should only use props?*/
}
}