2 - Lösung
by waalzer
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.24/browser.js"></script>
<script src="https://npmcdn.com/react@latest/dist/react-with-addons.js"></script>
<script src="https://npmcdn.com/react-dom@latest/dist/react-dom.js"></script>
<script src="https://facebook.github.io/react/js/jsfiddle-integration-babel.js"></script>
<div id="container">
<!-- This element's contents will be replaced with your component. -->
</div>
Babel + JSX
var Heading = React.createClass({
render: function () {
return (
<h1>Hello World</h1>
);
}
});
var List = React.createClass({
render: function () {
return (
<ul>
<li>Banane</li>
<li>Apfel</li>
<li>Birne</li>
</ul>
);
}
});
var App = React.createClass({
render: function () {
return (
<div>
<Heading/>
<List/>
</div>
);
}
});
ReactDOM.render(
<App/>,
document.getElementById('container')
);