4 ms·
I don't get JSX, especially now that 0.12 requires you to use createFactory (a big improvement over the old API) to encapsulate all the static JSX parts. With J
by malandrew 12y ago
I don't get JSX, especially now that 0.12 requires you to use createFactory (a big improvement over the old API) to encapsulate all the static JSX parts. With JSX, you're losing all the things that make having a proper programming language useful.
Have you given react-hyperscript a chance?
https://github.com/mlmorg/react-hyperscript https://github.com/mlmorg/react-hyperscript
Having first class functions for creating DOM makes it much easier to keep your DOM state creation dry. It's more tedious if you use it just like JSX, but if you recognize where you are repeating yourself over and over again, it's trivially easy to write functions that encapsulate all the repetitive structures in your HTML.
Furthermore, you don't completely break all the tools out there like eslint and whatnot. The h-script blends really nicely with solutions like RCSS and JSS.
- danabramov 12y agoLinting has not been an issue for a looong time since you can just lint the output of the transform. And designers love JSX, and having designers feel confident working directly on components saves huge amount of time.