Closed pspeter3 closed 8 years ago
It seems like onMouseDown
would likely be more correct.
Would using React event/attribute system be beneficial here? Why?
I’ll close because I don’t have plans to change this but feel free to continue the discussion.
I had erroneously believed that connecting a drag source and drop target was performance wise expensive since it was outside of the React render cycle. I do wonder if there would be value since it would mean there is only one system to reason about
I don’t think it’s that expensive per se to be honest. If you check http://gaearon.github.io/react-dnd/examples-sortable-stress.html it works pretty fast despite having 1000 items. Currently backends have no dependency on React and can potentially be reused outside of it, and I’d like to keep them this way.
Reading through the code, it seems that connecting a drag source mutates the DOM nodes and registers handlers as opposed to using React's handlers attribute setting. Is it possible to use React's attribute and event system instead?
If not, is it possible to safely connect the DragSource lazily, during an
onClick
handler?