sweet-jsx
v0.2.0
Published
Use JSX compiler from inside Sweet.js macro
Downloads
2
Readme
sweet-jsx
Use JSX and Sweet.js macros together.
WARNING: it can be used only with locally installed Sweet.js compiler or with sweetify.
This macros fences JSX syntax inside jsx
-tagged template string and compiles
it down to JS with respect to hygiene. So you can write JSX like that:
render: function() {
var x = 42;
return jsx `<div>The answer is {x}</div>`;
}
It even allows to use other macros inside interpolations:
macro plusone {
rule { $x:expr } => { $x + 1 }
}
var dom = jsx `
<div>{plusone 41}</div>
`