嗨,大家好,
我目前无法发布特定的代码示例,因为它目前太混乱了,但我认为我已经隔离了重现此问题所需的步骤。
该错误抛出在DragDropMonitor.prototype.canDropOnTarget
因为它无法找到带有targetID的目标(显然)。
用例:我正在构建可排序的树,我需要重新放置拖动和悬停的项目
到其父节点之后:
还有更多的事情:虽然发生错误,但仍然可以解决。
谢谢!
+1我也遇到这个问题
请提供一个重现该问题的示例。 那我看看
这可能在2.1.0中已修复。
我将关闭,但如果没有请通知我,然后我将重新开放。
@gaearon我最近升级到react-dnd v5,此问题再次被复制。 似乎它在2.6.0
和3.0.2
但是在4.0.5
和5.0.0
。
有什么消息吗?
@gaearon有更新吗?
这里同样的问题
5.0.0
这里同样的问题
这里同样的问题
同样的问题,有什么修复建议吗?
有人有运气吗?
我在react-sortable-tree外部源样本上遇到此问题。 拖到红色区域。
https://frontend-collective.github.io/react-sortable-tree/?path=/story/advanced --drag-from-external-source
https://github.com/frontend-collective/react-sortable-tree/blob/master/stories/external-node.js
vendors~main.91acd83f50dfbcb80997.bundle.js:1 Uncaught Invariant Violation: Expected to find a valid target.
at module.exports (https://frontend-collective.github.io/react-sortable-tree/vendors~main.91acd83f50dfbcb80997.bundle.js:2:592)
at DragDropMonitorImpl.canDropOnTarget (https://frontend-collective.github.io/react-sortable-tree/vendors~main.91acd83f50dfbcb80997.bundle.js:2:186636)
at DropTargetMonitorImpl.canDrop (https://frontend-collective.github.io/react-sortable-tree/vendors~main.91acd83f50dfbcb80997.bundle.js:2:71541)
at https://frontend-collective.github.io/react-sortable-tree/main.91acd83f50dfbcb80997.bundle.js:1:132866
at DragDropContainer.getCurrentState (https://frontend-collective.github.io/react-sortable-tree/vendors~main.91acd83f50dfbcb80997.bundle.js:2:87049)
at DragDropContainer._this.handleChange (https://frontend-collective.github.io/react-sortable-tree/vendors~main.91acd83f50dfbcb80997.bundle.js:2:84210)
at handleChange (https://frontend-collective.github.io/react-sortable-tree/vendors~main.91acd83f50dfbcb80997.bundle.js:2:185746)
at dispatch (https://frontend-collective.github.io/react-sortable-tree/vendors~main.91acd83f50dfbcb80997.bundle.js:2:168058)
at Object.endDrag (https://frontend-collective.github.io/react-sortable-tree/vendors~main.91acd83f50dfbcb80997.bundle.js:2:199234)
at HTML5Backend.handleTopDragEndCapture (https://frontend-collective.github.io/react-sortable-tree/vendors~main.91acd83f50dfbcb80997.bundle.js:2:152270)
最有用的评论
这里同样的问题