DEV Community

Discussion on: Help! I am Overwhelmed With React and It's Preventing Me From Finding A Workflow

Collapse
 
ben profile image
Ben Halpern

What is it that we need React for which we couldn't do with jQuery, for instance?

There's nothing you couldn't do with jQuery, but React makes keeping track of the "state" of a page about 10000000x easier. It's also generally more performant in complicated UI situations because it does minimal DOM manipulation and does most of its work in memory via what it calls the "virtual DOM".

React lets you code as if you were throwing away the whole page each time something happens and rendering from scratch based on the new situation. If you have an add to cart button and a cart icon displaying the number of items in a cart, with jQuery it's possible for things to get complicated quickly as different actions affect different things. React makes complicated UI pretty simple.

jQuery is much simpler for just dropping in and working with, but React eliminates complexity if you lean in to it.

React Native definitely helped React gain traction and commitment from Facebook. It was a big reason people finally started paying attention, but its true origins are pretty inherent to the problem of generating complex UI. Angular at the time truly sucked, and so did lots of stuff that was pretty popular. React really changed things.

React took good established declarative programming ideas that were already popular in game dev (I don't know this first hand, but I've heard it described this way and it makes sense). Games are an incredibly complex state management problem and they'd solved a lot of these problems before UI development needed to.

Thread Thread
 
niorad profile image
Antonio Radovcic

About game-dev: Games often use immediate-mode-GUI, which has some overlap with how React works.

medium.com/@Huxpro/is-reactjs-imgu...