Created
January 22, 2014 18:27
-
-
Save andreypopp/8564388 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro jsx { | |
case { _ $body } => { | |
var transform = require('react-tools').transform; | |
var body = #{ $body }[0].token.value.raw; | |
var transformed = transform('/** @jsx React.DOM */' + body).slice(21); | |
var tokens = parser.read(transformed); | |
tokens.pop(); // EOF | |
return tokens; | |
} | |
} | |
var x = jsx `<div className={y}>Hello, {name}</div>`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment