3 ms·
You can use React and virtual dom without JSX. Not that it's pleasant though.
by mateuszf 9y ago
You can use React and virtual dom without JSX. Not that it's pleasant though.
- yomly 9y agoI definitely preferred Mithril's m('div') over JSX <div></div>. The closing tags are overly verbose for me.
- masklinn 9y agoFWIW the hyperscript helper is generally h rather than m, and there's a hyperscript helper available for react with the expected semantics[0]: https://github.com/mlmorg/react-hyperscript https://github.com/mlmorg/react-hyperscript [0] in the sense that it supports normal hyperscript semantics and replacing the selector with a React component
- mekkkkkk 9y agoAs soon as the markup reaches a certain level, the verbosity (closing tags in particular) of JSX benefits you more than the terseness of hyperscript. Of course you can argue that you should split your components into smaller chunks, but that is, in my experience, rarely good just for the sake of readability.
- brlewis 9y agoMy group tried Mithril both with and without JSX. With JSX was more readable for the code we were writing.
- masklinn 9y ago> Not that it's pleasant though. "Raw" react is perfectly OK, and react + hyperscript[0] is great. [0] https://github.com/mlmorg/react-hyperscript https://github.com/mlmorg/react-hyperscript