Created by Antonio Felguerez
Manipulating and changing the real DOM is expensive, so React manages a virtual DOM for efficiency
The React DOM calculates differences and only updates the real DOM when necessary
// Let's create a React component called HelloMessage
var HelloMessage = React.createClass({
// React.createClass() takes an object.
// `render` is the only required property.
// write HTML inside of the `render` function.
render: function () {
return (
<div>
<h1>hello</h1>
</div>
)
}
});
// React.render is a function that takes two arguments: // 1. What you want to render // 2. Where to render it React.render(< HelloMessage />, document.body);