Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's quite possible to use react with nothing else: no build tools, no transpilers, no fancy JSX, so in terms of tooling complexity, it can be as simple as you want or as complex as you want.

Regarding the complexity of the underlying system, I think this is not a concern of the typical frontend developer. It has nothing to do with JavaScript or the web. If you are writing a "simple" C program on Linux, would you be concerned about the complexity of the underlying C library (yes glibc is rather big and complex) or the Linux kernel? You won't. This is the point of abstractions. If you want, you don't have to learn about any of these; treat the implementation as a black box and start writing actual frontend code.



Any resources you can provide about how to use React without JSX? JSX is a blocker for me.


> JSX is not a requirement for using React. Using React without JSX is especially convenient when you don't want to set up compilation in your build environment.

> Each JSX element is just syntactic sugar for calling React.createElement(component, props, ...children). So, anything you can do with JSX can also be done with just plain JavaScript.

Source: https://facebook.github.io/react/docs/react-without-jsx.html


Sure. At the bare minimum, you write "manual" `React.createElement()` calls. To simplify or shorten things, you can alias `React.createElement()` to something like `h()`.

There's also a variety of libs to help with that process. We have an existing ES5/Backbone app that's built with Require.js, and we don't have a "compile" step in there. We just added our first couple React+Redux-based features into that codebase, but can't use JSX due to that lack of compilation. I opted to bring in https://github.com/Jador/react-hyperscript-helpers as an alternative to JSX. Not perfect, but it's a suitable alternative given our limitations. There's several other "virtual DOM/hyperscript"-ish packages out there as well.


It's basically just to use the React.createElement API that JSX transpiles to. I say give JSX a chance though.


I had an initial negative reaction to JSX, as well. It grows on you, though.


Might I suggest .dom[0] instead of React if you are planning to use plain JS. It is tiny and has a slightly simpler API which is nice for plain ES6

[0]: https://github.com/wavesoft/dot-dom





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: