from Hacker News

Show HN: React without a build step (no JSX)

by amk_ on 9/1/17, 10:41 AM with 1 comments

  • by amk_ on 9/1/17, 10:53 AM

    React is my preferred frontend library, so rather than ditch it when I needed to work with a CMS I decided to go JSX-free and write my component in plain ES2015 with Preact's hyperscript/createElement syntax. I thought I'd write up a few tips and a demo widget to show how it works.

    Overall it's not a bad experience. JSX makes HTML feel more at home, but tends to obscure the underlying Javascript. Composition and higher-order components are more obvious in plain JS. If I was writing a library using those patterns heavily I might be tempted to go JSX-free even if bundling with Webpack + Babel.

    BTW the Codepen version of the post has much better code formatting: https://codepen.io/alexkrolick/post/react-without-a-build-st...