> We want ReactJS to render out component only once, and we want jQuery to be responsible for all…
ChillyPenguin
1

ChillyPenguin, your suggestion looks legit too.

The approach you’re suggesting looks a bit more logic-heavy to me. Plus, the maintainability concerns me too. In my example, the jQuery UI Sortable logic is encapsulated in the <Sortable> component I introduce. In your example I see plugin logic not only in the list component, but in the parent component too.

In my opinion, I think moving the responsibility for all future DOM updates from React to jQuery makes more sense.

Yes, from the React point of view we then lose control of this part of the application, but we can still manipulate the state in the <Sortable> component by hooking-up on the jQuery UI Sortable callbacks.

Show your support

Clapping shows how much you appreciated Kaloyan Kosev’s story.