You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
572 B

/**
* @jsx React.DOM
*/
var HELLO_COMPONENT = "\
/** @jsx React.DOM */\n\
var HelloMessage = React.createClass({\n\
render: function() {\n\
return <div>Hello {this.props.name}</div>;\n\
}\n\
});\n\
\n\
React.renderComponent(<HelloMessage name=\"John\" />, mountNode);\
";
var transformer = function(code) {
return JSXTransformer.transform(code).code;
}
React.renderComponent(
<ReactPlayground
codeText={HELLO_COMPONENT}
renderCode={true}
transformer={transformer}
showCompiledJSTab={false}
/>,
document.getElementById('jsxCompiler')
);