News for hackers. Stuff that matters.
Re:Learn Raw React – No JSX, No Flux, No ES6, No Webpack by manojlds on Sunday February 14, 2016 @01:55AM (#11097423)
Why not JSX? To me, JSX is part of React. If someone starting with React sees all that React.create element, they will run away.
Re:Learn Raw React – No JSX, No Flux, No ES6, No Webpack by jamesknelson on Sunday February 14, 2016 @02:17AM (#11097469)
Author here. My target audience here was really people who've already decided they're going to use React, and are keen on understanding what is going on under the hood. And while I do love JSX (and use it in my own projects), my feeling is that to really grok React, writing something without JSX is invaluable.
Re:Learn Raw React – No JSX, No Flux, No ES6, No Webpack by SiVal on Sunday February 14, 2016 @03:28AM (#11097585)
I'm part of that target audience, and you scored a bullseye with me. I always prefer to learn a new technology this way, by building very simple things from scratch and making minor modifications this way and that until I know what all the low-level parts do. Then, you can add some conveniences to the mix explaining what they do in terms of the underlying technology I just learned (and I can tell which parts are the base technology and which belong to this add-on), until I feel I could recreate these conveniences or build my own alternatives, if I chose to.

That way, I can decide for myself how to use the technology, break away from the typical stack of add-ons at any point I choose and take it from there in a direction that better suits my needs, dig in and figure out what's going on if I have a problem, and so on, rather than being helplessly dependent on a magical black box.

Thank you for starting off by teaching low-level React without any JSX, Flux, Redux, or whatever. I wish more tutorials did that.

Re:Learn Raw React – No JSX, No Flux, No ES6, No Webpack by dclowd9901 on Sunday February 14, 2016 @04:37AM (#11097695)
When I started learning iOS dev, every tutorial pointed me at the interface builder. It drove me nuts because I'm doing this magic and things are happening but when something fails I have no clue what to do, and guess what: things failed a lot and for weird reasons when you used IB and didn't know how it worked under the hood.

Granted JSX is far less bloated than IB, but its important to understand <Component /> bootstraps a react class component and <div> just renders a div.

Re:Learn Raw React – No JSX, No Flux, No ES6, No Webpack by antris on Sunday February 14, 2016 @09:07AM (#11098293)
> If someone starting with React sees all that React.create element, they will run away.

That's a possible reaction. Other developers would refactor instead of running away, though. Not using JSX doesn't mean typing React.createElement all over the place.

var e = React.createElement

And you already have much neater code. You can even go further and create functions for p, h1, input etc. and you're almost down to the expression power of JSX. And as a bonus, you don't have to spend time learning the JSX compiler and syntax.

Re:Learn Raw React – No JSX, No Flux, No ES6, No Webpack by bgilroy26 on Sunday February 14, 2016 @02:08AM (#11097447)
I don't think this is intended to replace 101-level tutorials. This is to help break down what's going on behind the scenes after you've been through todolist etc.

In the article Mr. Nelson says the intended audience are people who have "spent a couple hours investigating" already.

Re:Learn Raw React – No JSX, No Flux, No ES6, No Webpack by DatBear on Sunday February 14, 2016 @10:54AM (#11098691)
Absolutely this. I just started learning React a few days ago, and I absolutely would not have given it a chance with all those React.createElements. That looks like hell.
Re:Learn Raw React – No JSX, No Flux, No ES6, No Webpack by benatkin on Sunday February 14, 2016 @01:59AM (#11097428)
Some people don't like JSX. This is fine. But to imply that it's not part of React by calling the non-JSX variant "raw React" is misleading.
Re:Learn Raw React – No JSX, No Flux, No ES6, No Webpack by antris on Sunday February 14, 2016 @09:12AM (#11098307)
It's not misleading at all. I've created several React apps without JSX. I just didn't feel I had a need for it, and React without JSX worked really well.

People make these exaggerated comparisons of raw React code vs. JSX where they show unrefactored code with React.createElement spammed all over the place. With functional programming principles you can cut that syntax down to almost the expression power of JSX.

Re:Learn Raw React – No JSX, No Flux, No ES6, No Webpack by peletiah on Sunday February 14, 2016 @09:34AM (#11098369)
> you can cut that syntax down to almost the expression power of JSX.

What was the benefit for you over simply using JSX?

Re:Learn Raw React – No JSX, No Flux, No ES6, No Webpack by antris on Sunday February 14, 2016 @10:06AM (#11098502)
No need to use or understand a compiler. Also plain JS has better existing tooling (IDE plugins etc.) than JSX.
Re:Learn Raw React – No JSX, No Flux, No ES6, No Webpack by adamwong246 on Sunday February 14, 2016 @11:32AM (#11098881)
Not for me. I hate JSX, mainly because I like coffeescript and jade. I write all my code, view and otherwise, in coffee.