place the JSXTranformer.js
from the react package next to the jsxTransform.js
file.
/** @jsx React.DOM */
// filename: Comment.jsx
define([
'react/react'
], function(
React
) {
return React.createClass({
render: function() {
return (
<div className="commentBox">
Hello, world! I am a CommentBox.
</div>
);
}
});
});
require([
'react/react',
'react/jsxTransform!./Comment.jsx'
], function(
React,
Comment
) {
return React.renderComponent(Comment(),
document.body
);
});