3 ms·
Agreed, opting not to use JSX and then complaining about a lack of ergonomics seems pretty contrived. Yeah, the raw function calls aren't particularly friendly,
by vcarl 11y ago
Agreed, opting not to use JSX and then complaining about a lack of ergonomics seems pretty contrived. Yeah, the raw function calls aren't particularly friendly, that's why JSX exists. If more people opted not to use JSX, I'm sure there would be better options for friendly createElement/createFactory.
He also doesn't mention the learning curve, and I'd argue that function calls for DOM is less beginner friendly. It's pretty easy to mentally map a render function to its output because they're so syntactically similar.
- Ronsenshi 11y agoNot sure how much relevant it is, but author's stance on JSX reminds me of a meme known as "Baton Roue" which depicts person throwing a stick into the wheel of the bicycle he's riding. In other words - sure you don't have to use JSX, but if you really decided to work with React you are highly advised to go with JSX because that's what makes work with it much easier: you get familiar syntax which is easily parseable when somebody else is reading a code. However, if you decided against JSX then you're doing yourself a disservice, because sticking to raw JS does not improve development process at all, probably even opposite.
- mercer 11y agoFurthermore, in the situations where I cannot use JSX, I actually like the explicit nature of how you need to specify properties. In fact, as a general comment, the article actually solidifies my choice of using React precisely because it's 'verbose' in the right way: it makes working with something (inherently?) messy explicit, and as a result much easier and pleasant. As I learned how to work with React I've had quite a few moments where I got frustrated trying to get something done, only to realize that I was doing it wrong and that React was 'coaxing' me into doing things right. Very often, without trying, I'd do things in a way that suddenly made things 'click', where in the past my solution would've turned out messy, and where in the future even using other libraries/frameworks and applying what I learned will lead to a better result. I really think the 'pit of success' idea applies (which was mentioned in the initial video presenting React).