yungsters
12 years ago
7 changed files with 100 additions and 11 deletions
@ -1,14 +1,14 @@ |
|||||
--- |
--- |
||||
pygments: true |
pygments: true |
||||
name: React |
name: React |
||||
react_version: 0.3.0 |
react_version: 0.3.0 |
||||
exclude: |
exclude: |
||||
- Gemfile |
- Gemfile |
||||
- Gemfile.lock |
- Gemfile.lock |
||||
- README.md |
- README.md |
||||
- Rakefile |
- Rakefile |
||||
redcarpet: |
redcarpet: |
||||
extensions: |
extensions: |
||||
- fenced_code_blocks |
- fenced_code_blocks |
||||
markdown: redcarpet |
markdown: redcarpet |
||||
baseurl: /react |
baseurl: /react |
||||
|
@ -0,0 +1,19 @@ |
|||||
|
/** |
||||
|
* @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);\ |
||||
|
"; |
||||
|
|
||||
|
React.renderComponent( |
||||
|
<ReactPlayground codeText={HELLO_COMPONENT} renderCode={true} />, |
||||
|
document.getElementById('jsxCompiler') |
||||
|
); |
@ -0,0 +1,19 @@ |
|||||
|
/** |
||||
|
* @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);\ |
||||
|
"; |
||||
|
|
||||
|
React.renderComponent( |
||||
|
ReactPlayground( {codeText:HELLO_COMPONENT, renderCode:true}, null ), |
||||
|
document.getElementById('jsxCompiler') |
||||
|
); |
@ -0,0 +1,14 @@ |
|||||
|
--- |
||||
|
layout: default |
||||
|
title: JSX Compiler Service |
||||
|
id: jsx-compiler |
||||
|
--- |
||||
|
<div class="jsxCompiler"> |
||||
|
<h1>JSX Compiler</h1> |
||||
|
<p> |
||||
|
This tool demonstrates how <a href="/react/docs/syntax.html">JSX syntax</a> |
||||
|
is desguared into native JavaScript. |
||||
|
</p> |
||||
|
<div id="jsxCompiler"></div> |
||||
|
<script type="text/javascript" src="js/jsx-compiler.js"></script> |
||||
|
</div> |
Loading…
Reference in new issue