Dragging is very slow with many DOM items on page

时间:2018-03-25 18:58:38

标签: reactjs react-dnd

React DnD doesn't appear to scale well.

I have a list of five hundred drop targets and it take several seconds to pick up an element.

Is there anyway of speeding this up?

The list scrolls perfectly smoothly.

1 个答案:

答案 0 :(得分:0)

我正在使用react-virtual来减少现有DOM元素的数量,但不幸的是,绘图性能远远落后于原生渲染。

另外,一个有用的线程......

https://github.com/react-dnd/react-dnd/issues/421

  

虽然从技术上讲,你可以将React DnD性能提升到~3000左右   项目,没有办法让它在没有任何一点之后不会滞后   更改API(并使其不太有用)。如果你有成千上万的   行,我认为你应该使用虚拟化列表。