News for hackers. Stuff that matters.
Re:Bootstrap 5 will remove jQuery as a dependency by paulddraper on Wednesday February 13, 2019 @09:59AM (#19153552)
What does jQuery do to play poorly with React that this reimplementation doesn't?
Re:Bootstrap 5 will remove jQuery as a dependency by sandGorgon on Wednesday February 13, 2019 @12:32PM (#19154774)
React lifecycle - the virtual dom breaks down when you are manipulating the dom directly. It can still be done, but it's a bit weird.

Incidentally one of the most interesting react apps that plays super nice with jQuery is the new WordPress editor. I have nothing but respect at how they made it work with the tons of bad js code out there.

Re:Bootstrap 5 will remove jQuery as a dependency by petilon on Wednesday February 13, 2019 @11:02AM (#19154010)
I have used jQuery in a React app without issues. It is no worse than making direct DOM calls.

React is great for rendering, but you can’t implement direct-manipulation on top of virtual DOM. Direct-manipulation means interactively resizing, drag & drop and so on. To implement this you need to know the position and size of real DOM elements. There is no "React way" to query the position and size of elements, so interactivity has to be implemented the old-school way, by interacting with real DOM. You can call native DOM methods to do this, but jQuery makes it easy. There are lots of shortcuts in jQuery. You can certainly do it without jQuery too, but unless reducing download size by around 85KB is very important to you, there is no reason you shouldn’t take advantage of the ease-of-use of jQuery.

Keep in mind that once you manipulate DOM directly (using jQuery or not) React can’t update those elements. For more on this look up "Integrating with Other Libraries" in React documentation.

Re:Bootstrap 5 will remove jQuery as a dependency by wuliwong on Wednesday February 13, 2019 @11:34AM (#19154276)
> There is no "React way" to query the position and size of elements, so interactivity has to be implemented the old-school way, by interacting with real DOM.

I have helped build an interactive timeline web app where we explicitly placed elements on the page and moved them around based on user interactions. We did this with react and no jquery.

>React is great for rendering, but you can’t implement direct-manipulation on top of virtual DOM. Direct-manipulation means interactively resizing, drag & drop and so on.

There are react "drag and drop" libraries that have no dependency on jquery and don't break the react lifecycle for the elements. For example https://github.com/react-dnd/react-dnd

Maybe i'm not following what you are saying but I haven't encountered something that required me to use jquery and I've built some pretty ambitious interfaces.