01. 快速开始
导论
基本的
<!DOCTYPE html>
<html>
<head>
<script src="../build/react.js"></script>
<script src="../build/JSXTransformer.js"></script>
</head>
<body>
<div id="example"></div>
<script type="text/jsx">
// ** Our code goes here! **
</script>
</body>
</html>
const HelloMessage = React.createClass({
render: function() {
return <div>Hello {this.props.name}</div>;
}
});
React.render(
<HelloMessage name="John" />,
document.getElementById("container")
);
class ExampleComponent extends React.Component {
constructor() {
super();
this._handleClick = this._handleClick.bind(this);
this.state = Store.getState();
} // ...
}
在对于