React Base Fiddle (JSX)
Starting point for creating JSFiddles with React. This uses React with Addons.
by Chace
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.24/browser.js"></script>
<script src="https://fb.me/react-with-addons-0.14.6.js"></script>
<script src="https://fb.me/react-dom-0.14.6.js"></script>
<script src="https://facebook.github.io/react/js/jsfiddle-integration-babel.js"></script>
<div id="myApp"></div>
CSS
div#hello {
font-family: Arial;
font-size: 1.2em;
}
JavaScript 1.7
var HelloWorld = React.createClass({
render: function() {
return (
<div onClick={this.sayGoodbye} id="hello">Hello, {this.props.name}</div>
);
},
sayGoodbye: function(event) {
console.log("you clicked me");
event.currentTarget.innerText='booyah';
}
});
ReactDOM.render(
<HelloWorld name="Jim" />,
document.getElementById('myApp')
);