Add hJSX() helper to ease JSX usage in Babel
Now it is (a bit) easier to use JSX with Cycle.js
If you are using Babel, then add the following line at the top of the file which will use JSX:
/** @jsx hJSX */Then import hJSX:
import {hJSX} from '@cycle/web';And now JSX will render VTrees:
return (
<ul>
<li><a className="link" href="/">Home</a></li>
<li><a className="link" href="/about">About</a></li>
</ul>
);equivalent to
return h('ul', [
h('li', [
h('a.link', {href: '/'}, 'Home')
]),
h('li', [
h('a.link', {href: '/about'}, 'About')
])
]);