You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
366 B
24 lines
366 B
/**
|
|
* @jsx ReactDOM
|
|
*/
|
|
|
|
var React = require('React');
|
|
|
|
var MyApp = React.createComponent({
|
|
|
|
showMessage: function() {
|
|
alert('hello react!');
|
|
},
|
|
|
|
render: function() {
|
|
return (
|
|
<div onClick={this.showMessage.bind(this)}>
|
|
Click Me
|
|
</div>
|
|
);
|
|
}
|
|
});
|
|
|
|
|
|
// Only needed once per app.
|
|
React.renderComponent(<MyApp />, document.body);
|
|
|