News for hackers. Stuff that matters.
Re:JSX is no longer my friend by spicyj on Tuesday March 15, 2016 @07:56PM (#11293975)
> React.dom.ul(...) was kinda cool

React.DOM.ul() works as it always did. Even if we change that (since it's kinda silly to ship down a big list of tags that we don't otherwise need), you can also do

var ul = React.createFactory('ul');

and then ul(). No big deal.

Re:JSX is no longer my friend by staltz on Wednesday March 16, 2016 @03:38AM (#11295640)
It's not that simple, and hyperscript [A] is much more practical than createFactory [B].

[B] requires the first argument always to be props, so most of the time for empty props, people end up always giving `{}` or `null` as the first arg. In [A] they are optional. In JSX if you don't have props you don't need to provide any "empty props" object.

In [A], children are always an array, while in [B] sometimes a single-child parent only accepts that child as last argument, instead of an array with one child. Otherwise it's a runtime error or warning. This special case treatment is only visible when using [B], but transparent when using JSX.

In [A], the first (optional) argument can be a CSS selector to declare the classnames and id. In [B] you have to give it explicitly as props.

All this indicates that while React supports a non-JSX workflow, [B] is way less practical than JSX, probably because Facebook itself uses JSX extensively, and supporting non-JSX workflow was an afterthought when releasing React to the public.