Fixed broken /commentsBox example

This commit is contained in:
jwngr
2016-04-22 10:18:51 -07:00
parent 1e824a46f1
commit 5ae4c61ccb

View File

@@ -30,11 +30,11 @@ var CommentList = React.createClass({
var CommentForm = React.createClass({
handleSubmit: function(event) {
event.preventDefault();
var author = this.refs.author.getDOMNode().value.trim();
var text = this.refs.text.getDOMNode().value.trim();
var author = this.refs.author.value.trim();
var text = this.refs.text.value.trim();
this.props.onCommentSubmit({author: author, text: text});
this.refs.author.getDOMNode().value = '';
this.refs.text.getDOMNode().value = '';
this.refs.author.value = '';
this.refs.text.value = '';
},
render: function() {
@@ -80,7 +80,7 @@ var CommentBox = React.createClass({
}
});
React.render(
ReactDOM.render(
<CommentBox />,
document.getElementById('content')
);