Update app.js

Passed event into handleSubmit, removed return false.
This commit is contained in:
Jay Landro
2016-04-08 17:45:16 -05:00
parent d83bc77940
commit 792dad6767

View File

@@ -28,14 +28,13 @@ var CommentList = React.createClass({
var CommentForm = React.createClass({
handleSubmit: function(e) {
e.preventDefault();
handleSubmit: function(event) {
event.preventDefault();
var author = this.refs.author.getDOMNode().value.trim();
var text = this.refs.text.getDOMNode().value.trim();
this.props.onCommentSubmit({author: author, text: text});
this.refs.author.getDOMNode().value = '';
this.refs.text.getDOMNode().value = '';
return false;
},
render: function() {