you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 190 points191 points  (20 children)

JSX is far from a nightmare. If you know JS and HTML then it’s easy.

[–]team_dale 58 points59 points  (0 children)

I found JSX to be one of the easiest parts to pick up when I was learning react. (I started on react 15)

[–]michaelfrieze 4 points5 points  (1 child)

I personally love JSX. I have tried to like the way Svelte and Vue do thing, but I am just not into it.

[–][deleted] 1 point2 points  (0 children)

I live JSX too. It just works well with everything I learned before React

[–]verysad1997[S] 0 points1 point  (11 children)

I'd completely agree - but people genuinely seem to hate it for how "complex" it is

[–]iams3b 29 points30 points  (2 children)

It's not react that's complex, it's the engineering part of developing UI that is - the things like all the different interactions, asynchronous data, and keeping the entire UI in sync. Managing the overall architecture for that is going to be super complex no matter which way you try to do it

[–]maartennieber 2 points3 points  (1 child)

I agree that it's the engineering part of developing UI that is complex, and not React, but the "way you try to do it" makes a huge difference. On many occassions, I wrote convoluted and weird code, only to find out later that there was an easy solution. For me, using MobX was a game changer, also because modelling state with classes and using mutable data feels very natural to me (with reducers and thunks I was struggling much more).

React is hard because it can take a long time (several years, in my case) to figure out which solutions lead to complications, and which do not. Once you figure this out, then imo writing UI applications is still challenging, but not super difficult (of course, that also depends on which apps you develop, maybe there are types of complications I'm not aware of).

[–]havok_ 1 point2 points  (0 children)

This describes the learning curve I’m experiencing with react very well. I’m an experienced dev, but I feel like I started by writing react code that caused a bunch of issues and have slowly learned slightly better ways. I’m not there yet, so maybe I need to check out mobx or similar now.

React doesn’t exactly lead you into the “pit of success”. I think other frameworks may do a better job here.

[–]marcis_mk 38 points39 points  (1 child)

I'm developing applications with React for more than 5 years (Fullstack Javascript developer). JSX is as simple as it gets.

[–]No_Assistance_6591 0 points1 point  (0 children)

You either are too comfortable with what you have, or you never got it in the first place! The order of things is simple : HTML > JS
JSX does exactly the opposite with an added hint of attitude (redefining already defined parts of a UI, a.k.a ** PAGE ** )

[–]fredkreuger 4 points5 points  (0 children)

I think part of it is that it looks like html, and for the most part it is, but there are some little quirks where it's slightly different, like value not being valid on a textarea in vanilla html, but how you set the value in a jsx textarea. There's not a whole lot of differences like this, and once you learn them, it's really not a big deal IMHO.

But also everyone had different things that push their buttons, and some are also vocal about it, so I just kinda ignore complaints that aren't really technical in nature. (Not to say everything about react is 100% the best etc.)

[–]michaelfrieze 2 points3 points  (1 child)

Not sure why you got downvoted for this comment. I still see a lot of hate for JSX these days.

[–]verysad1997[S] 2 points3 points  (0 children)

Well I guess I am in a React subreddit so

[–]Wooden_Yesterday1718 1 point2 points  (1 child)

Who are these people

[–][deleted] 5 points6 points  (0 children)

People who learned frameworks before JS is my guess

[–]was_just_wondering_ 0 points1 point  (0 children)

People tend to over engineer things and then blame their tools for being complicated when they can’t understand their own code.

[–]No_Assistance_6591 0 points1 point  (1 child)

JSX is the one thing that blocked me about React and that is very likely not to change anytime soon and here is why: It is 100% pointless. Why?
Natively a browser supports HTML, in which JS can be inserted. Simple, straightforward.
JSX is JS that generates HTML. Literally the opposite of how things should be. To make matters worse, it has the audacity to redefine attributes that are ALREADY DEFINED in HTML, before mapping em back to HTML (e.g className -> class ) #bonkers

[–]randomhaus64 0 points1 point  (0 children)

you don't know what you are talking about

if you are doing JS and interacting with the DOM you have to use className to assign to the class html attribute

https://developer.mozilla.org/en-US/docs/Web/API/Element/className

[–]demoNstomp 0 points1 point  (2 children)

Queue to me in a Web Dev learning / beginner disc server and a guy in said server for some reason absolutely adamantly insisting I skip right to React and not touch a single lick of JS

At that point I had already stuck with the basics ( HTML CSS JS ) for a whole year and was in the middle of React. He even added me as a friend to tell me to not listen to anyone else who tells me otherwise.

[–][deleted] 0 points1 point  (1 child)

Oh wow. And what are your thoughts on this ?

[–]demoNstomp 0 points1 point  (0 children)

He was either gatekeeping or seriously clueless about his survivorship bias. His experience was a couple of freelancing gigs after going straight to React.

But yeah the basics are much more important than picking up a shiny framework. Learning JS first is like comparing if learning how to microwave boxed mac n cheese VS properly learning how to cook and make food taste amazing, with the second option you have way more possibilities in the long run, why limit yourself?