Данный код выдает ошибку
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' : 'have not liked';
return (
React.createElement('p', null, 'You {text} this. Click to toggle.')
);
}
});
ReactDOM.render(
LikeButton,
document.getElementById('content')
);
Uncaught Error: Invariant Violation: ReactDOM.render(): Invalid component element. Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.