make react JSX transformer more generic and allow JSX comments - closes #841

This commit is contained in:
Sebastian McKenzie
2015-02-21 12:53:09 +11:00
parent 74186241f9
commit 35bd510930
4 changed files with 42 additions and 4 deletions

View File

@@ -0,0 +1,8 @@
/** @jsx dom */
<Foo></Foo>;
var profile = <div>
<img src="avatar.png" className="profile" />
<h3>{[user.firstName, user.lastName].join(" ")}</h3>
</div>;

View File

@@ -0,0 +1,14 @@
/** @jsx dom */
dom(Foo, null);
var profile = dom(
"div",
null,
dom("img", { src: "avatar.png", className: "profile" }),
dom(
"h3",
null,
[user.firstName, user.lastName].join(" ")
)
);