var MyApp = React.createClass({
render() {
return <div>Hi! I'm React</div>;
}
});
React.render(<MyApp />, document.body);
var React = require('react'),
SimpleView = React.createClass({
render: function () {
return <h1><strong>Example 1:</strong> A simple component</h1>;
}
});
React.renderComponent(SimpleView(), document.getElementById('example'));
render: function() {
var someProp = 'bar';
console.log('component render()', this.props);
return <div>
<AnotherComponent foo={someProp} model={this.props.model} />
</div>;
}
render: function() {
return <h3>Click count:
<span className='label label-default'>{this.state.clicks}</span>
</h3>;
}
/** @jsx React.DOM */
render: function () {
return <div>
<h2>
<strong>Example 4:</strong> React App
</h2>
</div>;
}
/** regular DOM */
render: function () {
return React.DOM.div(null,
React.DOM.h2(null, React.DOM.strong(null, "Example 4:"), " React App")
);
}
http://facebook.github.io/react/ React
https://facebook.github.io/flux/ Flux
http://redux.js.org/ Redux
http://habrahabr.ru/post/248799/ Краткое руководство по React JS
http://andreysalomatin.me/vviedieniie-v-react-js/ Введение в React.js
https://www.youtube.com/watch?v=mFEoarLnnqM Thinking in React
http://habrahabr.ru/post/256965/ Что такое Virtual DOM?