@H_502_1@
var LikeButton = React.createClass({
getInitialState: function() {
return {liked: false};
},
handleClick: function(event) {
this.setState({liked: !this.state.liked});
},
render: function() {
var text = this.state.liked ? ‘like’ : ‘haven\’t liked’;
return (
@H_502_1@
You {text} this. Click to toggle.
);
}
}); @H_502_1@ReactDOM.render(,document.getElementById(‘example’) );
var LikeButton = React.createClass({
getInitialState: function() {
return {liked: false};
},
handleClick: function(event) {
this.setState({liked: !this.state.liked});
},
render: function() {
var text = this.state.liked ? ‘like’ : ‘haven\’t liked’;
return (
@H_502_1@
You {text} this. Click to toggle.
);
}
}); @H_502_1@ReactDOM.render(,document.getElementById(‘example’) );