Hacker News new | past | comments | ask | show | jobs | submit login

argh.. I hate the style of mixing JS with markup language....



Well its actually function calls that look like markup language. Which is why you can write the function calls yourself if you hate it.


Me too, so last week I created gulp-pug-hyperscript to compile Pug/Jade templates to Hyperscript [1].

In order to completely avoid JS in the markup, event binding must be done outside of the markup. I do this by using event delegation rather than binding directly to elements.

[1]: https://github.com/nextorigin/gulp-pug-hyperscript


Agreed. Please tell me there's another syntax for this. Please don't tell me that we're stuck with this sad relic of the past.


There is. You can write regular function calls like this:

  React.createElement('h1', {}, 'Hello')
Personally I like JSX a lot, but you don't have to use it.





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

Search: