3 ms·
JSX isn't mandatory, so you can just write plain old JS if you want. And if you want to use JSX but don't want to use a full-blown toolchain for development, th
by RussianCow 11y ago
JSX isn't mandatory, so you can just write plain old JS if you want. And if you want to use JSX but don't want to use a full-blown toolchain for development, there is an in-browser JSX transform library[0] that you can include to do the compilation on the client side.
[0]: https://facebook.github.io/react/docs/tooling-integration.html#in-browser-jsx-transform https://facebook.github.io/react/docs/tooling-integration.ht...
- seivan 11y agoTo be fair React without JSX is pretty bad. I did that for a while with TypeScript before it got JSX support.
- cloverich 11y agoI agree with you but to provide some more context, some people seem to prefer the non-JSX approach. Here is a (random) example of what that looks like: https://github.com/littlebits/react-popover/blob/master/examples/basic/index.js https://github.com/littlebits/react-popover/blob/master/exam...
- seivan 11y agoOh yeah, I remember seeing that with coffee-script without the parentheses.
- malandrew 11y agoReact with JSX is pretty bad. A library like https://github.com/mlmorg/react-hyperscript https://github.com/mlmorg/react-hyperscript solves the verbosity with not using JSX.