ChillyPenguin, your suggestion looks legit too.
Kaloyan Kosev
1

Many thanks for your response, Kaloyan. I’m sorry, but I have to disagree with you.

By moving all future responsibility for UI update from React to jQuery, you’ve lost control your state data. And if React is not a representation of state data at the view level, then what on Earth is it?

Yes, my approach does entail more plumbing for sure, but that’s a small price to pay for having React keep control of the state, IMHO. With your approach, React is used to display the list in the first instance only. After that, React really may as well not be there at all.

I suspect, the “hooking-up on the jQuery UI Sortable callbacks” approach to updating React’s state is probably going to entail as much extra code as I used in my approach. You would have to make sure that React doesn’t call a setState() on that list after the initial render, otherwise React will see that jQueryUI has been rearranging the DOM behind its back, and won’t be happy about it. You can probably make all that work, but I think it would be messy.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.