DEV Community

[Comment from a deleted post]
Collapse
 
jonrandy profile image
Jon Randy 🎖️

My thoughts after using React for one day.... Why on earth is this sh*t so popular? This JSX is an abomination. I'm never using React again

Collapse
 
jackmellis profile image
Jack

I think this is everyone's thoughts after one day. Come back to this in a few months and see if you still think this. For many it's an elegant solution to the markup/logic separation that had been unavoidable up until jsx was devised

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

I hate it more each time I'm forced to work with it. It's about as elegant as the bad old days of PHP where an app's layout and logic were all bundled together. It was a terrible idea then, and it's a terrible idea now. I've been a professional developer for over 25 years, and have never seen such a ridiculous regression in the structuring of an application.

Try RiotJS or Svelte (which seems heavily inspired by the former)... much, much better

 
jackmellis profile image
Jack

I used to work on a Vue application with Single File Components and I couldn't understand why you'd ever want to litter your javascript with html elements, it seemed ridiculous.

After moving to React and spending several years with it, I now strongly believe that all of the negativity towards jsx is due to badly written components.

Having said all that, perhaps jsx is just not for you 😄

Collapse
 
matthewbdaly profile image
Matthew Daly • Edited

It is really weird when you first start using it, but there's really not that much to JSX that you don't already know.

There's a handful of keywords like class and for that can't be used in a Javascript file because they're reserved words, so they're replaced with className and htmlFor, for example. Otherwise it's all just the HTML and JS you already know - there's not really any templating-specific syntax you have to learn. Some of the conditional logic seems a bit weird if you're not used to it, such as using something like {showAlert && <span className="alert">Alert!</span>}, but it's all stuff you'll have seen before, just in a slightly different context.

React is also conceptually simpler than something like Vue. A React component is in essence just a function that takes in arguments as props and spits out HTML, and that's relatively easy to understand.

Collapse
 
jonrandy profile image
Jon Randy 🎖️

I know and understand full well what it is. It's just plain awful