sweet-jsx

0.2.0 • Public • Published

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>
`

/sweet-jsx/

    Package Sidebar

    Install

    npm i sweet-jsx

    Weekly Downloads

    0

    Version

    0.2.0

    License

    MIT

    Last publish

    Collaborators

    • andreypopp